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.Region; 020 021 /** 022 * The persistence interface for the region 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.RegionPersistenceImpl 030 * @see RegionUtil 031 * @generated 032 */ 033 @ProviderType 034 public interface RegionPersistence extends BasePersistence<Region> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link RegionUtil} to access the region persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Returns all the regions where countryId = ?. 043 * 044 * @param countryId the country ID 045 * @return the matching regions 046 */ 047 public java.util.List<Region> findByCountryId(long countryId); 048 049 /** 050 * Returns a range of all the regions where countryId = ?. 051 * 052 * <p> 053 * 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 RegionModelImpl}. 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. 054 * </p> 055 * 056 * @param countryId the country ID 057 * @param start the lower bound of the range of regions 058 * @param end the upper bound of the range of regions (not inclusive) 059 * @return the range of matching regions 060 */ 061 public java.util.List<Region> findByCountryId(long countryId, int start, 062 int end); 063 064 /** 065 * Returns an ordered range of all the regions where countryId = ?. 066 * 067 * <p> 068 * 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 RegionModelImpl}. 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. 069 * </p> 070 * 071 * @param countryId the country ID 072 * @param start the lower bound of the range of regions 073 * @param end the upper bound of the range of regions (not inclusive) 074 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 075 * @return the ordered range of matching regions 076 */ 077 public java.util.List<Region> findByCountryId(long countryId, int start, 078 int end, 079 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 080 081 /** 082 * Returns the first region in the ordered set where countryId = ?. 083 * 084 * @param countryId the country ID 085 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 086 * @return the first matching region 087 * @throws NoSuchRegionException if a matching region could not be found 088 */ 089 public Region findByCountryId_First(long countryId, 090 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 091 throws com.liferay.portal.NoSuchRegionException; 092 093 /** 094 * Returns the first region in the ordered set where countryId = ?. 095 * 096 * @param countryId the country ID 097 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 098 * @return the first matching region, or <code>null</code> if a matching region could not be found 099 */ 100 public Region fetchByCountryId_First(long countryId, 101 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 102 103 /** 104 * Returns the last region in the ordered set where countryId = ?. 105 * 106 * @param countryId the country ID 107 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 108 * @return the last matching region 109 * @throws NoSuchRegionException if a matching region could not be found 110 */ 111 public Region findByCountryId_Last(long countryId, 112 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 113 throws com.liferay.portal.NoSuchRegionException; 114 115 /** 116 * Returns the last region in the ordered set where countryId = ?. 117 * 118 * @param countryId the country ID 119 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 120 * @return the last matching region, or <code>null</code> if a matching region could not be found 121 */ 122 public Region fetchByCountryId_Last(long countryId, 123 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 124 125 /** 126 * Returns the regions before and after the current region in the ordered set where countryId = ?. 127 * 128 * @param regionId the primary key of the current region 129 * @param countryId the country ID 130 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 131 * @return the previous, current, and next region 132 * @throws NoSuchRegionException if a region with the primary key could not be found 133 */ 134 public Region[] findByCountryId_PrevAndNext(long regionId, long countryId, 135 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 136 throws com.liferay.portal.NoSuchRegionException; 137 138 /** 139 * Removes all the regions where countryId = ? from the database. 140 * 141 * @param countryId the country ID 142 */ 143 public void removeByCountryId(long countryId); 144 145 /** 146 * Returns the number of regions where countryId = ?. 147 * 148 * @param countryId the country ID 149 * @return the number of matching regions 150 */ 151 public int countByCountryId(long countryId); 152 153 /** 154 * Returns all the regions where active = ?. 155 * 156 * @param active the active 157 * @return the matching regions 158 */ 159 public java.util.List<Region> findByActive(boolean active); 160 161 /** 162 * Returns a range of all the regions where active = ?. 163 * 164 * <p> 165 * 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 RegionModelImpl}. 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. 166 * </p> 167 * 168 * @param active the active 169 * @param start the lower bound of the range of regions 170 * @param end the upper bound of the range of regions (not inclusive) 171 * @return the range of matching regions 172 */ 173 public java.util.List<Region> findByActive(boolean active, int start, 174 int end); 175 176 /** 177 * Returns an ordered range of all the regions where active = ?. 178 * 179 * <p> 180 * 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 RegionModelImpl}. 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. 181 * </p> 182 * 183 * @param active the active 184 * @param start the lower bound of the range of regions 185 * @param end the upper bound of the range of regions (not inclusive) 186 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 187 * @return the ordered range of matching regions 188 */ 189 public java.util.List<Region> findByActive(boolean active, int start, 190 int end, 191 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 192 193 /** 194 * Returns the first region in the ordered set where active = ?. 195 * 196 * @param active the active 197 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 198 * @return the first matching region 199 * @throws NoSuchRegionException if a matching region could not be found 200 */ 201 public Region findByActive_First(boolean active, 202 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 203 throws com.liferay.portal.NoSuchRegionException; 204 205 /** 206 * Returns the first region in the ordered set where active = ?. 207 * 208 * @param active the active 209 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 210 * @return the first matching region, or <code>null</code> if a matching region could not be found 211 */ 212 public Region fetchByActive_First(boolean active, 213 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 214 215 /** 216 * Returns the last region in the ordered set where active = ?. 217 * 218 * @param active the active 219 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 220 * @return the last matching region 221 * @throws NoSuchRegionException if a matching region could not be found 222 */ 223 public Region findByActive_Last(boolean active, 224 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 225 throws com.liferay.portal.NoSuchRegionException; 226 227 /** 228 * Returns the last region in the ordered set where active = ?. 229 * 230 * @param active the active 231 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 232 * @return the last matching region, or <code>null</code> if a matching region could not be found 233 */ 234 public Region fetchByActive_Last(boolean active, 235 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 236 237 /** 238 * Returns the regions before and after the current region in the ordered set where active = ?. 239 * 240 * @param regionId the primary key of the current region 241 * @param active the active 242 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 243 * @return the previous, current, and next region 244 * @throws NoSuchRegionException if a region with the primary key could not be found 245 */ 246 public Region[] findByActive_PrevAndNext(long regionId, boolean active, 247 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 248 throws com.liferay.portal.NoSuchRegionException; 249 250 /** 251 * Removes all the regions where active = ? from the database. 252 * 253 * @param active the active 254 */ 255 public void removeByActive(boolean active); 256 257 /** 258 * Returns the number of regions where active = ?. 259 * 260 * @param active the active 261 * @return the number of matching regions 262 */ 263 public int countByActive(boolean active); 264 265 /** 266 * Returns the region where countryId = ? and regionCode = ? or throws a {@link NoSuchRegionException} if it could not be found. 267 * 268 * @param countryId the country ID 269 * @param regionCode the region code 270 * @return the matching region 271 * @throws NoSuchRegionException if a matching region could not be found 272 */ 273 public Region findByC_R(long countryId, java.lang.String regionCode) 274 throws com.liferay.portal.NoSuchRegionException; 275 276 /** 277 * Returns the region where countryId = ? and regionCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 278 * 279 * @param countryId the country ID 280 * @param regionCode the region code 281 * @return the matching region, or <code>null</code> if a matching region could not be found 282 */ 283 public Region fetchByC_R(long countryId, java.lang.String regionCode); 284 285 /** 286 * Returns the region where countryId = ? and regionCode = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 287 * 288 * @param countryId the country ID 289 * @param regionCode the region code 290 * @param retrieveFromCache whether to use the finder cache 291 * @return the matching region, or <code>null</code> if a matching region could not be found 292 */ 293 public Region fetchByC_R(long countryId, java.lang.String regionCode, 294 boolean retrieveFromCache); 295 296 /** 297 * Removes the region where countryId = ? and regionCode = ? from the database. 298 * 299 * @param countryId the country ID 300 * @param regionCode the region code 301 * @return the region that was removed 302 */ 303 public Region removeByC_R(long countryId, java.lang.String regionCode) 304 throws com.liferay.portal.NoSuchRegionException; 305 306 /** 307 * Returns the number of regions where countryId = ? and regionCode = ?. 308 * 309 * @param countryId the country ID 310 * @param regionCode the region code 311 * @return the number of matching regions 312 */ 313 public int countByC_R(long countryId, java.lang.String regionCode); 314 315 /** 316 * Returns all the regions where countryId = ? and active = ?. 317 * 318 * @param countryId the country ID 319 * @param active the active 320 * @return the matching regions 321 */ 322 public java.util.List<Region> findByC_A(long countryId, boolean active); 323 324 /** 325 * Returns a range of all the regions where countryId = ? and active = ?. 326 * 327 * <p> 328 * 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 RegionModelImpl}. 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. 329 * </p> 330 * 331 * @param countryId the country ID 332 * @param active the active 333 * @param start the lower bound of the range of regions 334 * @param end the upper bound of the range of regions (not inclusive) 335 * @return the range of matching regions 336 */ 337 public java.util.List<Region> findByC_A(long countryId, boolean active, 338 int start, int end); 339 340 /** 341 * Returns an ordered range of all the regions where countryId = ? and active = ?. 342 * 343 * <p> 344 * 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 RegionModelImpl}. 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. 345 * </p> 346 * 347 * @param countryId the country ID 348 * @param active the active 349 * @param start the lower bound of the range of regions 350 * @param end the upper bound of the range of regions (not inclusive) 351 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 352 * @return the ordered range of matching regions 353 */ 354 public java.util.List<Region> findByC_A(long countryId, boolean active, 355 int start, int end, 356 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 357 358 /** 359 * Returns the first region in the ordered set where countryId = ? and active = ?. 360 * 361 * @param countryId the country ID 362 * @param active the active 363 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 364 * @return the first matching region 365 * @throws NoSuchRegionException if a matching region could not be found 366 */ 367 public Region findByC_A_First(long countryId, boolean active, 368 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 369 throws com.liferay.portal.NoSuchRegionException; 370 371 /** 372 * Returns the first region in the ordered set where countryId = ? and active = ?. 373 * 374 * @param countryId the country ID 375 * @param active the active 376 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 377 * @return the first matching region, or <code>null</code> if a matching region could not be found 378 */ 379 public Region fetchByC_A_First(long countryId, boolean active, 380 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 381 382 /** 383 * Returns the last region in the ordered set where countryId = ? and active = ?. 384 * 385 * @param countryId the country ID 386 * @param active the active 387 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 388 * @return the last matching region 389 * @throws NoSuchRegionException if a matching region could not be found 390 */ 391 public Region findByC_A_Last(long countryId, boolean active, 392 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 393 throws com.liferay.portal.NoSuchRegionException; 394 395 /** 396 * Returns the last region in the ordered set where countryId = ? and active = ?. 397 * 398 * @param countryId the country ID 399 * @param active the active 400 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 401 * @return the last matching region, or <code>null</code> if a matching region could not be found 402 */ 403 public Region fetchByC_A_Last(long countryId, boolean active, 404 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 405 406 /** 407 * Returns the regions before and after the current region in the ordered set where countryId = ? and active = ?. 408 * 409 * @param regionId the primary key of the current region 410 * @param countryId the country ID 411 * @param active the active 412 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 413 * @return the previous, current, and next region 414 * @throws NoSuchRegionException if a region with the primary key could not be found 415 */ 416 public Region[] findByC_A_PrevAndNext(long regionId, long countryId, 417 boolean active, 418 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator) 419 throws com.liferay.portal.NoSuchRegionException; 420 421 /** 422 * Removes all the regions where countryId = ? and active = ? from the database. 423 * 424 * @param countryId the country ID 425 * @param active the active 426 */ 427 public void removeByC_A(long countryId, boolean active); 428 429 /** 430 * Returns the number of regions where countryId = ? and active = ?. 431 * 432 * @param countryId the country ID 433 * @param active the active 434 * @return the number of matching regions 435 */ 436 public int countByC_A(long countryId, boolean active); 437 438 /** 439 * Caches the region in the entity cache if it is enabled. 440 * 441 * @param region the region 442 */ 443 public void cacheResult(Region region); 444 445 /** 446 * Caches the regions in the entity cache if it is enabled. 447 * 448 * @param regions the regions 449 */ 450 public void cacheResult(java.util.List<Region> regions); 451 452 /** 453 * Creates a new region with the primary key. Does not add the region to the database. 454 * 455 * @param regionId the primary key for the new region 456 * @return the new region 457 */ 458 public Region create(long regionId); 459 460 /** 461 * Removes the region with the primary key from the database. Also notifies the appropriate model listeners. 462 * 463 * @param regionId the primary key of the region 464 * @return the region that was removed 465 * @throws NoSuchRegionException if a region with the primary key could not be found 466 */ 467 public Region remove(long regionId) 468 throws com.liferay.portal.NoSuchRegionException; 469 470 public Region updateImpl(Region region); 471 472 /** 473 * Returns the region with the primary key or throws a {@link NoSuchRegionException} if it could not be found. 474 * 475 * @param regionId the primary key of the region 476 * @return the region 477 * @throws NoSuchRegionException if a region with the primary key could not be found 478 */ 479 public Region findByPrimaryKey(long regionId) 480 throws com.liferay.portal.NoSuchRegionException; 481 482 /** 483 * Returns the region with the primary key or returns <code>null</code> if it could not be found. 484 * 485 * @param regionId the primary key of the region 486 * @return the region, or <code>null</code> if a region with the primary key could not be found 487 */ 488 public Region fetchByPrimaryKey(long regionId); 489 490 @Override 491 public java.util.Map<java.io.Serializable, Region> fetchByPrimaryKeys( 492 java.util.Set<java.io.Serializable> primaryKeys); 493 494 /** 495 * Returns all the regions. 496 * 497 * @return the regions 498 */ 499 public java.util.List<Region> findAll(); 500 501 /** 502 * Returns a range of all the regions. 503 * 504 * <p> 505 * 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 RegionModelImpl}. 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. 506 * </p> 507 * 508 * @param start the lower bound of the range of regions 509 * @param end the upper bound of the range of regions (not inclusive) 510 * @return the range of regions 511 */ 512 public java.util.List<Region> findAll(int start, int end); 513 514 /** 515 * Returns an ordered range of all the regions. 516 * 517 * <p> 518 * 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 RegionModelImpl}. 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. 519 * </p> 520 * 521 * @param start the lower bound of the range of regions 522 * @param end the upper bound of the range of regions (not inclusive) 523 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 524 * @return the ordered range of regions 525 */ 526 public java.util.List<Region> findAll(int start, int end, 527 com.liferay.portal.kernel.util.OrderByComparator<Region> orderByComparator); 528 529 /** 530 * Removes all the regions from the database. 531 */ 532 public void removeAll(); 533 534 /** 535 * Returns the number of regions. 536 * 537 * @return the number of regions 538 */ 539 public int countAll(); 540 }