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