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