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 com.liferay.portal.service.persistence.impl.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 NoSuchCountryException} if it could not be found. 043 * 044 * @param name the name 045 * @return the matching country 046 * @throws NoSuchCountryException if a matching country could not be found 047 */ 048 public Country findByName(java.lang.String name) 049 throws com.liferay.portal.exception.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 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 retrieve from the finder cache 064 * @return the matching country, or <code>null</code> if a matching country could not be found 065 */ 066 public Country fetchByName(java.lang.String name, boolean retrieveFromCache); 067 068 /** 069 * Removes the country where name = ? from the database. 070 * 071 * @param name the name 072 * @return the country that was removed 073 */ 074 public Country removeByName(java.lang.String name) 075 throws com.liferay.portal.exception.NoSuchCountryException; 076 077 /** 078 * Returns the number of countries where name = ?. 079 * 080 * @param name the name 081 * @return the number of matching countries 082 */ 083 public int countByName(java.lang.String name); 084 085 /** 086 * Returns the country where a2 = ? or throws a {@link NoSuchCountryException} if it could not be found. 087 * 088 * @param a2 the a2 089 * @return the matching country 090 * @throws NoSuchCountryException if a matching country could not be found 091 */ 092 public Country findByA2(java.lang.String a2) 093 throws com.liferay.portal.exception.NoSuchCountryException; 094 095 /** 096 * Returns the country where a2 = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 097 * 098 * @param a2 the a2 099 * @return the matching country, or <code>null</code> if a matching country could not be found 100 */ 101 public Country fetchByA2(java.lang.String a2); 102 103 /** 104 * Returns the country where a2 = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 105 * 106 * @param a2 the a2 107 * @param retrieveFromCache whether to retrieve from the finder cache 108 * @return the matching country, or <code>null</code> if a matching country could not be found 109 */ 110 public Country fetchByA2(java.lang.String a2, boolean retrieveFromCache); 111 112 /** 113 * Removes the country where a2 = ? from the database. 114 * 115 * @param a2 the a2 116 * @return the country that was removed 117 */ 118 public Country removeByA2(java.lang.String a2) 119 throws com.liferay.portal.exception.NoSuchCountryException; 120 121 /** 122 * Returns the number of countries where a2 = ?. 123 * 124 * @param a2 the a2 125 * @return the number of matching countries 126 */ 127 public int countByA2(java.lang.String a2); 128 129 /** 130 * Returns the country where a3 = ? or throws a {@link NoSuchCountryException} if it could not be found. 131 * 132 * @param a3 the a3 133 * @return the matching country 134 * @throws NoSuchCountryException if a matching country could not be found 135 */ 136 public Country findByA3(java.lang.String a3) 137 throws com.liferay.portal.exception.NoSuchCountryException; 138 139 /** 140 * Returns the country where a3 = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 141 * 142 * @param a3 the a3 143 * @return the matching country, or <code>null</code> if a matching country could not be found 144 */ 145 public Country fetchByA3(java.lang.String a3); 146 147 /** 148 * Returns the country where a3 = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 149 * 150 * @param a3 the a3 151 * @param retrieveFromCache whether to retrieve from the finder cache 152 * @return the matching country, or <code>null</code> if a matching country could not be found 153 */ 154 public Country fetchByA3(java.lang.String a3, boolean retrieveFromCache); 155 156 /** 157 * Removes the country where a3 = ? from the database. 158 * 159 * @param a3 the a3 160 * @return the country that was removed 161 */ 162 public Country removeByA3(java.lang.String a3) 163 throws com.liferay.portal.exception.NoSuchCountryException; 164 165 /** 166 * Returns the number of countries where a3 = ?. 167 * 168 * @param a3 the a3 169 * @return the number of matching countries 170 */ 171 public int countByA3(java.lang.String a3); 172 173 /** 174 * Returns all the countries where active = ?. 175 * 176 * @param active the active 177 * @return the matching countries 178 */ 179 public java.util.List<Country> findByActive(boolean active); 180 181 /** 182 * Returns a range of all the countries where active = ?. 183 * 184 * <p> 185 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 186 * </p> 187 * 188 * @param active the active 189 * @param start the lower bound of the range of countries 190 * @param end the upper bound of the range of countries (not inclusive) 191 * @return the range of matching countries 192 */ 193 public java.util.List<Country> findByActive(boolean active, int start, 194 int end); 195 196 /** 197 * Returns an ordered range of all the countries where active = ?. 198 * 199 * <p> 200 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 201 * </p> 202 * 203 * @param active the active 204 * @param start the lower bound of the range of countries 205 * @param end the upper bound of the range of countries (not inclusive) 206 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 207 * @return the ordered range of matching countries 208 */ 209 public java.util.List<Country> findByActive(boolean active, int start, 210 int end, 211 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator); 212 213 /** 214 * Returns an ordered range of all the countries where active = ?. 215 * 216 * <p> 217 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 218 * </p> 219 * 220 * @param active the active 221 * @param start the lower bound of the range of countries 222 * @param end the upper bound of the range of countries (not inclusive) 223 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 224 * @param retrieveFromCache whether to retrieve from the finder cache 225 * @return the ordered range of matching countries 226 */ 227 public java.util.List<Country> findByActive(boolean active, int start, 228 int end, 229 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator, 230 boolean retrieveFromCache); 231 232 /** 233 * Returns the first country in the ordered set where active = ?. 234 * 235 * @param active the active 236 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 237 * @return the first matching country 238 * @throws NoSuchCountryException if a matching country could not be found 239 */ 240 public Country findByActive_First(boolean active, 241 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator) 242 throws com.liferay.portal.exception.NoSuchCountryException; 243 244 /** 245 * Returns the first country in the ordered set where active = ?. 246 * 247 * @param active the active 248 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 249 * @return the first matching country, or <code>null</code> if a matching country could not be found 250 */ 251 public Country fetchByActive_First(boolean active, 252 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator); 253 254 /** 255 * Returns the last country in the ordered set where active = ?. 256 * 257 * @param active the active 258 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 259 * @return the last matching country 260 * @throws NoSuchCountryException if a matching country could not be found 261 */ 262 public Country findByActive_Last(boolean active, 263 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator) 264 throws com.liferay.portal.exception.NoSuchCountryException; 265 266 /** 267 * Returns the last country in the ordered set where active = ?. 268 * 269 * @param active the active 270 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 271 * @return the last matching country, or <code>null</code> if a matching country could not be found 272 */ 273 public Country fetchByActive_Last(boolean active, 274 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator); 275 276 /** 277 * Returns the countries before and after the current country in the ordered set where active = ?. 278 * 279 * @param countryId the primary key of the current country 280 * @param active the active 281 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 282 * @return the previous, current, and next country 283 * @throws NoSuchCountryException if a country with the primary key could not be found 284 */ 285 public Country[] findByActive_PrevAndNext(long countryId, boolean active, 286 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator) 287 throws com.liferay.portal.exception.NoSuchCountryException; 288 289 /** 290 * Removes all the countries where active = ? from the database. 291 * 292 * @param active the active 293 */ 294 public void removeByActive(boolean active); 295 296 /** 297 * Returns the number of countries where active = ?. 298 * 299 * @param active the active 300 * @return the number of matching countries 301 */ 302 public int countByActive(boolean active); 303 304 /** 305 * Caches the country in the entity cache if it is enabled. 306 * 307 * @param country the country 308 */ 309 public void cacheResult(Country country); 310 311 /** 312 * Caches the countries in the entity cache if it is enabled. 313 * 314 * @param countries the countries 315 */ 316 public void cacheResult(java.util.List<Country> countries); 317 318 /** 319 * Creates a new country with the primary key. Does not add the country to the database. 320 * 321 * @param countryId the primary key for the new country 322 * @return the new country 323 */ 324 public Country create(long countryId); 325 326 /** 327 * Removes the country with the primary key from the database. Also notifies the appropriate model listeners. 328 * 329 * @param countryId the primary key of the country 330 * @return the country that was removed 331 * @throws NoSuchCountryException if a country with the primary key could not be found 332 */ 333 public Country remove(long countryId) 334 throws com.liferay.portal.exception.NoSuchCountryException; 335 336 public Country updateImpl(Country country); 337 338 /** 339 * Returns the country with the primary key or throws a {@link NoSuchCountryException} if it could not be found. 340 * 341 * @param countryId the primary key of the country 342 * @return the country 343 * @throws NoSuchCountryException if a country with the primary key could not be found 344 */ 345 public Country findByPrimaryKey(long countryId) 346 throws com.liferay.portal.exception.NoSuchCountryException; 347 348 /** 349 * Returns the country with the primary key or returns <code>null</code> if it could not be found. 350 * 351 * @param countryId the primary key of the country 352 * @return the country, or <code>null</code> if a country with the primary key could not be found 353 */ 354 public Country fetchByPrimaryKey(long countryId); 355 356 @Override 357 public java.util.Map<java.io.Serializable, Country> fetchByPrimaryKeys( 358 java.util.Set<java.io.Serializable> primaryKeys); 359 360 /** 361 * Returns all the countries. 362 * 363 * @return the countries 364 */ 365 public java.util.List<Country> findAll(); 366 367 /** 368 * Returns a range of all the countries. 369 * 370 * <p> 371 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 372 * </p> 373 * 374 * @param start the lower bound of the range of countries 375 * @param end the upper bound of the range of countries (not inclusive) 376 * @return the range of countries 377 */ 378 public java.util.List<Country> findAll(int start, int end); 379 380 /** 381 * Returns an ordered range of all the countries. 382 * 383 * <p> 384 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 385 * </p> 386 * 387 * @param start the lower bound of the range of countries 388 * @param end the upper bound of the range of countries (not inclusive) 389 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 390 * @return the ordered range of countries 391 */ 392 public java.util.List<Country> findAll(int start, int end, 393 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator); 394 395 /** 396 * Returns an ordered range of all the countries. 397 * 398 * <p> 399 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 400 * </p> 401 * 402 * @param start the lower bound of the range of countries 403 * @param end the upper bound of the range of countries (not inclusive) 404 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 405 * @param retrieveFromCache whether to retrieve from the finder cache 406 * @return the ordered range of countries 407 */ 408 public java.util.List<Country> findAll(int start, int end, 409 com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator, 410 boolean retrieveFromCache); 411 412 /** 413 * Removes all the countries from the database. 414 */ 415 public void removeAll(); 416 417 /** 418 * Returns the number of countries. 419 * 420 * @return the number of countries 421 */ 422 public int countAll(); 423 424 @Override 425 public java.util.Set<java.lang.String> getBadColumnNames(); 426 }