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