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