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