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