001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.model.Country; 020 021 /** 022 * The persistence interface for the country service. 023 * 024 * <p> 025 * Caching information and settings can be found in <code>portal.properties</code> 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see CountryPersistenceImpl 030 * @see CountryUtil 031 * @generated 032 */ 033 @ProviderType 034 public interface CountryPersistence extends BasePersistence<Country> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link CountryUtil} to access the country persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Returns the country where name = ? or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found. 043 * 044 * @param name the name 045 * @return the matching country 046 * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found 047 */ 048 public com.liferay.portal.model.Country findByName(java.lang.String name) 049 throws com.liferay.portal.NoSuchCountryException; 050 051 /** 052 * Returns the country where name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 053 * 054 * @param name the name 055 * @return the matching country, or <code>null</code> if a matching country could not be found 056 */ 057 public com.liferay.portal.model.Country fetchByName(java.lang.String name); 058 059 /** 060 * Returns the country where name = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 061 * 062 * @param name the name 063 * @param retrieveFromCache whether to use the finder cache 064 * @return the matching country, or <code>null</code> if a matching country could not be found 065 */ 066 public com.liferay.portal.model.Country fetchByName(java.lang.String name, 067 boolean retrieveFromCache); 068 069 /** 070 * Removes the country where name = ? from the database. 071 * 072 * @param name the name 073 * @return the country that was removed 074 */ 075 public com.liferay.portal.model.Country removeByName(java.lang.String name) 076 throws com.liferay.portal.NoSuchCountryException; 077 078 /** 079 * Returns the number of countries where name = ?. 080 * 081 * @param name the name 082 * @return the number of matching countries 083 */ 084 public int countByName(java.lang.String name); 085 086 /** 087 * Returns the country where a2 = ? or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found. 088 * 089 * @param a2 the a2 090 * @return the matching country 091 * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found 092 */ 093 public com.liferay.portal.model.Country findByA2(java.lang.String a2) 094 throws com.liferay.portal.NoSuchCountryException; 095 096 /** 097 * Returns the country where a2 = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 098 * 099 * @param a2 the a2 100 * @return the matching country, or <code>null</code> if a matching country could not be found 101 */ 102 public com.liferay.portal.model.Country fetchByA2(java.lang.String a2); 103 104 /** 105 * Returns the country where a2 = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 106 * 107 * @param a2 the a2 108 * @param retrieveFromCache whether to use the finder cache 109 * @return the matching country, or <code>null</code> if a matching country could not be found 110 */ 111 public com.liferay.portal.model.Country fetchByA2(java.lang.String a2, 112 boolean retrieveFromCache); 113 114 /** 115 * Removes the country where a2 = ? from the database. 116 * 117 * @param a2 the a2 118 * @return the country that was removed 119 */ 120 public com.liferay.portal.model.Country removeByA2(java.lang.String a2) 121 throws com.liferay.portal.NoSuchCountryException; 122 123 /** 124 * Returns the number of countries where a2 = ?. 125 * 126 * @param a2 the a2 127 * @return the number of matching countries 128 */ 129 public int countByA2(java.lang.String a2); 130 131 /** 132 * Returns the country where a3 = ? or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found. 133 * 134 * @param a3 the a3 135 * @return the matching country 136 * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found 137 */ 138 public com.liferay.portal.model.Country findByA3(java.lang.String a3) 139 throws com.liferay.portal.NoSuchCountryException; 140 141 /** 142 * Returns the country where a3 = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 143 * 144 * @param a3 the a3 145 * @return the matching country, or <code>null</code> if a matching country could not be found 146 */ 147 public com.liferay.portal.model.Country fetchByA3(java.lang.String a3); 148 149 /** 150 * Returns the country where a3 = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 151 * 152 * @param a3 the a3 153 * @param retrieveFromCache whether to use the finder cache 154 * @return the matching country, or <code>null</code> if a matching country could not be found 155 */ 156 public com.liferay.portal.model.Country fetchByA3(java.lang.String a3, 157 boolean retrieveFromCache); 158 159 /** 160 * Removes the country where a3 = ? from the database. 161 * 162 * @param a3 the a3 163 * @return the country that was removed 164 */ 165 public com.liferay.portal.model.Country removeByA3(java.lang.String a3) 166 throws com.liferay.portal.NoSuchCountryException; 167 168 /** 169 * Returns the number of countries where a3 = ?. 170 * 171 * @param a3 the a3 172 * @return the number of matching countries 173 */ 174 public int countByA3(java.lang.String a3); 175 176 /** 177 * Returns all the countries where active = ?. 178 * 179 * @param active the active 180 * @return the matching countries 181 */ 182 public java.util.List<com.liferay.portal.model.Country> findByActive( 183 boolean active); 184 185 /** 186 * Returns a range of all the countries where active = ?. 187 * 188 * <p> 189 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 190 * </p> 191 * 192 * @param active the active 193 * @param start the lower bound of the range of countries 194 * @param end the upper bound of the range of countries (not inclusive) 195 * @return the range of matching countries 196 */ 197 public java.util.List<com.liferay.portal.model.Country> findByActive( 198 boolean active, int start, int end); 199 200 /** 201 * Returns an ordered range of all the countries where active = ?. 202 * 203 * <p> 204 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 205 * </p> 206 * 207 * @param active the active 208 * @param start the lower bound of the range of countries 209 * @param end the upper bound of the range of countries (not inclusive) 210 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 211 * @return the ordered range of matching countries 212 */ 213 public java.util.List<com.liferay.portal.model.Country> findByActive( 214 boolean active, int start, int end, 215 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Country> orderByComparator); 216 217 /** 218 * Returns the first country in the ordered set where active = ?. 219 * 220 * @param active the active 221 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 222 * @return the first matching country 223 * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found 224 */ 225 public com.liferay.portal.model.Country findByActive_First(boolean active, 226 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Country> orderByComparator) 227 throws com.liferay.portal.NoSuchCountryException; 228 229 /** 230 * Returns the first country in the ordered set where active = ?. 231 * 232 * @param active the active 233 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 234 * @return the first matching country, or <code>null</code> if a matching country could not be found 235 */ 236 public com.liferay.portal.model.Country fetchByActive_First( 237 boolean active, 238 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Country> orderByComparator); 239 240 /** 241 * Returns the last country in the ordered set where active = ?. 242 * 243 * @param active the active 244 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 245 * @return the last matching country 246 * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found 247 */ 248 public com.liferay.portal.model.Country findByActive_Last(boolean active, 249 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Country> orderByComparator) 250 throws com.liferay.portal.NoSuchCountryException; 251 252 /** 253 * Returns the last country in the ordered set where active = ?. 254 * 255 * @param active the active 256 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 257 * @return the last matching country, or <code>null</code> if a matching country could not be found 258 */ 259 public com.liferay.portal.model.Country fetchByActive_Last(boolean active, 260 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Country> orderByComparator); 261 262 /** 263 * Returns the countries before and after the current country in the ordered set where active = ?. 264 * 265 * @param countryId the primary key of the current country 266 * @param active the active 267 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 268 * @return the previous, current, and next country 269 * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found 270 */ 271 public com.liferay.portal.model.Country[] findByActive_PrevAndNext( 272 long countryId, boolean active, 273 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Country> orderByComparator) 274 throws com.liferay.portal.NoSuchCountryException; 275 276 /** 277 * Removes all the countries where active = ? from the database. 278 * 279 * @param active the active 280 */ 281 public void removeByActive(boolean active); 282 283 /** 284 * Returns the number of countries where active = ?. 285 * 286 * @param active the active 287 * @return the number of matching countries 288 */ 289 public int countByActive(boolean active); 290 291 /** 292 * Caches the country in the entity cache if it is enabled. 293 * 294 * @param country the country 295 */ 296 public void cacheResult(com.liferay.portal.model.Country country); 297 298 /** 299 * Caches the countries in the entity cache if it is enabled. 300 * 301 * @param countries the countries 302 */ 303 public void cacheResult( 304 java.util.List<com.liferay.portal.model.Country> countries); 305 306 /** 307 * Creates a new country with the primary key. Does not add the country to the database. 308 * 309 * @param countryId the primary key for the new country 310 * @return the new country 311 */ 312 public com.liferay.portal.model.Country create(long countryId); 313 314 /** 315 * Removes the country with the primary key from the database. Also notifies the appropriate model listeners. 316 * 317 * @param countryId the primary key of the country 318 * @return the country that was removed 319 * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found 320 */ 321 public com.liferay.portal.model.Country remove(long countryId) 322 throws com.liferay.portal.NoSuchCountryException; 323 324 public com.liferay.portal.model.Country updateImpl( 325 com.liferay.portal.model.Country country); 326 327 /** 328 * Returns the country with the primary key or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found. 329 * 330 * @param countryId the primary key of the country 331 * @return the country 332 * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found 333 */ 334 public com.liferay.portal.model.Country findByPrimaryKey(long countryId) 335 throws com.liferay.portal.NoSuchCountryException; 336 337 /** 338 * Returns the country with the primary key or returns <code>null</code> if it could not be found. 339 * 340 * @param countryId the primary key of the country 341 * @return the country, or <code>null</code> if a country with the primary key could not be found 342 */ 343 public com.liferay.portal.model.Country fetchByPrimaryKey(long countryId); 344 345 @Override 346 public java.util.Map<java.io.Serializable, com.liferay.portal.model.Country> fetchByPrimaryKeys( 347 java.util.Set<java.io.Serializable> primaryKeys); 348 349 /** 350 * Returns all the countries. 351 * 352 * @return the countries 353 */ 354 public java.util.List<com.liferay.portal.model.Country> findAll(); 355 356 /** 357 * Returns a range of all the countries. 358 * 359 * <p> 360 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 361 * </p> 362 * 363 * @param start the lower bound of the range of countries 364 * @param end the upper bound of the range of countries (not inclusive) 365 * @return the range of countries 366 */ 367 public java.util.List<com.liferay.portal.model.Country> findAll(int start, 368 int end); 369 370 /** 371 * Returns an ordered range of all the countries. 372 * 373 * <p> 374 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 375 * </p> 376 * 377 * @param start the lower bound of the range of countries 378 * @param end the upper bound of the range of countries (not inclusive) 379 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 380 * @return the ordered range of countries 381 */ 382 public java.util.List<com.liferay.portal.model.Country> findAll(int start, 383 int end, 384 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Country> orderByComparator); 385 386 /** 387 * Removes all the countries from the database. 388 */ 389 public void removeAll(); 390 391 /** 392 * Returns the number of countries. 393 * 394 * @return the number of countries 395 */ 396 public int countAll(); 397 }