001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.exception.SystemException; 022 import com.liferay.portal.kernel.util.OrderByComparator; 023 import com.liferay.portal.kernel.util.ReferenceRegistry; 024 import com.liferay.portal.model.Region; 025 import com.liferay.portal.service.ServiceContext; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the region service. This utility wraps {@link RegionPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see RegionPersistence 038 * @see RegionPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class RegionUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(Region region) { 060 getPersistence().clearCache(region); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) 067 throws SystemException { 068 return getPersistence().countWithDynamicQuery(dynamicQuery); 069 } 070 071 /** 072 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 073 */ 074 public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery) 075 throws SystemException { 076 return getPersistence().findWithDynamicQuery(dynamicQuery); 077 } 078 079 /** 080 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 081 */ 082 public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery, 083 int start, int end) throws SystemException { 084 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 085 } 086 087 /** 088 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 089 */ 090 public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery, 091 int start, int end, OrderByComparator orderByComparator) 092 throws SystemException { 093 return getPersistence() 094 .findWithDynamicQuery(dynamicQuery, start, end, 095 orderByComparator); 096 } 097 098 /** 099 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 100 */ 101 public static Region update(Region region) throws SystemException { 102 return getPersistence().update(region); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static Region update(Region region, ServiceContext serviceContext) 109 throws SystemException { 110 return getPersistence().update(region, serviceContext); 111 } 112 113 /** 114 * Returns all the regions where countryId = ?. 115 * 116 * @param countryId the country ID 117 * @return the matching regions 118 * @throws SystemException if a system exception occurred 119 */ 120 public static java.util.List<com.liferay.portal.model.Region> findByCountryId( 121 long countryId) 122 throws com.liferay.portal.kernel.exception.SystemException { 123 return getPersistence().findByCountryId(countryId); 124 } 125 126 /** 127 * Returns a range of all the regions where countryId = ?. 128 * 129 * <p> 130 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 131 * </p> 132 * 133 * @param countryId the country ID 134 * @param start the lower bound of the range of regions 135 * @param end the upper bound of the range of regions (not inclusive) 136 * @return the range of matching regions 137 * @throws SystemException if a system exception occurred 138 */ 139 public static java.util.List<com.liferay.portal.model.Region> findByCountryId( 140 long countryId, int start, int end) 141 throws com.liferay.portal.kernel.exception.SystemException { 142 return getPersistence().findByCountryId(countryId, start, end); 143 } 144 145 /** 146 * Returns an ordered range of all the regions where countryId = ?. 147 * 148 * <p> 149 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 150 * </p> 151 * 152 * @param countryId the country ID 153 * @param start the lower bound of the range of regions 154 * @param end the upper bound of the range of regions (not inclusive) 155 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 156 * @return the ordered range of matching regions 157 * @throws SystemException if a system exception occurred 158 */ 159 public static java.util.List<com.liferay.portal.model.Region> findByCountryId( 160 long countryId, int start, int end, 161 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 162 throws com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence() 164 .findByCountryId(countryId, start, end, orderByComparator); 165 } 166 167 /** 168 * Returns the first region in the ordered set where countryId = ?. 169 * 170 * @param countryId the country ID 171 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 172 * @return the first 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 static com.liferay.portal.model.Region findByCountryId_First( 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 return getPersistence() 182 .findByCountryId_First(countryId, orderByComparator); 183 } 184 185 /** 186 * Returns the first region in the ordered set where countryId = ?. 187 * 188 * @param countryId the country ID 189 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 190 * @return the first matching region, or <code>null</code> if a matching region could not be found 191 * @throws SystemException if a system exception occurred 192 */ 193 public static com.liferay.portal.model.Region fetchByCountryId_First( 194 long countryId, 195 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 196 throws com.liferay.portal.kernel.exception.SystemException { 197 return getPersistence() 198 .fetchByCountryId_First(countryId, orderByComparator); 199 } 200 201 /** 202 * Returns the last region in the ordered set where countryId = ?. 203 * 204 * @param countryId the country ID 205 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 206 * @return the last matching region 207 * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found 208 * @throws SystemException if a system exception occurred 209 */ 210 public static com.liferay.portal.model.Region findByCountryId_Last( 211 long countryId, 212 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 213 throws com.liferay.portal.NoSuchRegionException, 214 com.liferay.portal.kernel.exception.SystemException { 215 return getPersistence() 216 .findByCountryId_Last(countryId, orderByComparator); 217 } 218 219 /** 220 * Returns the last region in the ordered set where countryId = ?. 221 * 222 * @param countryId the country ID 223 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 224 * @return the last matching region, or <code>null</code> if a matching region could not be found 225 * @throws SystemException if a system exception occurred 226 */ 227 public static com.liferay.portal.model.Region fetchByCountryId_Last( 228 long countryId, 229 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 230 throws com.liferay.portal.kernel.exception.SystemException { 231 return getPersistence() 232 .fetchByCountryId_Last(countryId, orderByComparator); 233 } 234 235 /** 236 * Returns the regions before and after the current region in the ordered set where countryId = ?. 237 * 238 * @param regionId the primary key of the current region 239 * @param countryId the country ID 240 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 241 * @return the previous, current, and next region 242 * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found 243 * @throws SystemException if a system exception occurred 244 */ 245 public static com.liferay.portal.model.Region[] findByCountryId_PrevAndNext( 246 long regionId, long countryId, 247 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 248 throws com.liferay.portal.NoSuchRegionException, 249 com.liferay.portal.kernel.exception.SystemException { 250 return getPersistence() 251 .findByCountryId_PrevAndNext(regionId, countryId, 252 orderByComparator); 253 } 254 255 /** 256 * Removes all the regions where countryId = ? from the database. 257 * 258 * @param countryId the country ID 259 * @throws SystemException if a system exception occurred 260 */ 261 public static void removeByCountryId(long countryId) 262 throws com.liferay.portal.kernel.exception.SystemException { 263 getPersistence().removeByCountryId(countryId); 264 } 265 266 /** 267 * Returns the number of regions where countryId = ?. 268 * 269 * @param countryId the country ID 270 * @return the number of matching regions 271 * @throws SystemException if a system exception occurred 272 */ 273 public static int countByCountryId(long countryId) 274 throws com.liferay.portal.kernel.exception.SystemException { 275 return getPersistence().countByCountryId(countryId); 276 } 277 278 /** 279 * Returns all the regions where active = ?. 280 * 281 * @param active the active 282 * @return the matching regions 283 * @throws SystemException if a system exception occurred 284 */ 285 public static java.util.List<com.liferay.portal.model.Region> findByActive( 286 boolean active) 287 throws com.liferay.portal.kernel.exception.SystemException { 288 return getPersistence().findByActive(active); 289 } 290 291 /** 292 * Returns a range of all the regions where active = ?. 293 * 294 * <p> 295 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 296 * </p> 297 * 298 * @param active the active 299 * @param start the lower bound of the range of regions 300 * @param end the upper bound of the range of regions (not inclusive) 301 * @return the range of matching regions 302 * @throws SystemException if a system exception occurred 303 */ 304 public static java.util.List<com.liferay.portal.model.Region> findByActive( 305 boolean active, int start, int end) 306 throws com.liferay.portal.kernel.exception.SystemException { 307 return getPersistence().findByActive(active, start, end); 308 } 309 310 /** 311 * Returns an ordered range of all the regions where active = ?. 312 * 313 * <p> 314 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 315 * </p> 316 * 317 * @param active the active 318 * @param start the lower bound of the range of regions 319 * @param end the upper bound of the range of regions (not inclusive) 320 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 321 * @return the ordered range of matching regions 322 * @throws SystemException if a system exception occurred 323 */ 324 public static java.util.List<com.liferay.portal.model.Region> findByActive( 325 boolean active, int start, int end, 326 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 327 throws com.liferay.portal.kernel.exception.SystemException { 328 return getPersistence() 329 .findByActive(active, start, end, orderByComparator); 330 } 331 332 /** 333 * Returns the first region in the ordered set where active = ?. 334 * 335 * @param active the active 336 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 337 * @return the first matching region 338 * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found 339 * @throws SystemException if a system exception occurred 340 */ 341 public static com.liferay.portal.model.Region findByActive_First( 342 boolean active, 343 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 344 throws com.liferay.portal.NoSuchRegionException, 345 com.liferay.portal.kernel.exception.SystemException { 346 return getPersistence().findByActive_First(active, orderByComparator); 347 } 348 349 /** 350 * Returns the first region in the ordered set where active = ?. 351 * 352 * @param active the active 353 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 354 * @return the first matching region, or <code>null</code> if a matching region could not be found 355 * @throws SystemException if a system exception occurred 356 */ 357 public static com.liferay.portal.model.Region fetchByActive_First( 358 boolean active, 359 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 360 throws com.liferay.portal.kernel.exception.SystemException { 361 return getPersistence().fetchByActive_First(active, orderByComparator); 362 } 363 364 /** 365 * Returns the last region in the ordered set where active = ?. 366 * 367 * @param active the active 368 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 369 * @return the last matching region 370 * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found 371 * @throws SystemException if a system exception occurred 372 */ 373 public static com.liferay.portal.model.Region findByActive_Last( 374 boolean active, 375 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 376 throws com.liferay.portal.NoSuchRegionException, 377 com.liferay.portal.kernel.exception.SystemException { 378 return getPersistence().findByActive_Last(active, orderByComparator); 379 } 380 381 /** 382 * Returns the last region in the ordered set where active = ?. 383 * 384 * @param active the active 385 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 386 * @return the last matching region, or <code>null</code> if a matching region could not be found 387 * @throws SystemException if a system exception occurred 388 */ 389 public static com.liferay.portal.model.Region fetchByActive_Last( 390 boolean active, 391 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 392 throws com.liferay.portal.kernel.exception.SystemException { 393 return getPersistence().fetchByActive_Last(active, orderByComparator); 394 } 395 396 /** 397 * Returns the regions before and after the current region in the ordered set where active = ?. 398 * 399 * @param regionId the primary key of the current region 400 * @param active the active 401 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 static com.liferay.portal.model.Region[] findByActive_PrevAndNext( 407 long regionId, boolean active, 408 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 409 throws com.liferay.portal.NoSuchRegionException, 410 com.liferay.portal.kernel.exception.SystemException { 411 return getPersistence() 412 .findByActive_PrevAndNext(regionId, active, orderByComparator); 413 } 414 415 /** 416 * Removes all the regions where active = ? from the database. 417 * 418 * @param active the active 419 * @throws SystemException if a system exception occurred 420 */ 421 public static void removeByActive(boolean active) 422 throws com.liferay.portal.kernel.exception.SystemException { 423 getPersistence().removeByActive(active); 424 } 425 426 /** 427 * Returns the number of regions where active = ?. 428 * 429 * @param active the active 430 * @return the number of matching regions 431 * @throws SystemException if a system exception occurred 432 */ 433 public static int countByActive(boolean active) 434 throws com.liferay.portal.kernel.exception.SystemException { 435 return getPersistence().countByActive(active); 436 } 437 438 /** 439 * Returns the region where countryId = ? and regionCode = ? or throws a {@link com.liferay.portal.NoSuchRegionException} if it could not be found. 440 * 441 * @param countryId the country ID 442 * @param regionCode the region code 443 * @return the matching region 444 * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found 445 * @throws SystemException if a system exception occurred 446 */ 447 public static com.liferay.portal.model.Region findByC_R(long countryId, 448 java.lang.String regionCode) 449 throws com.liferay.portal.NoSuchRegionException, 450 com.liferay.portal.kernel.exception.SystemException { 451 return getPersistence().findByC_R(countryId, regionCode); 452 } 453 454 /** 455 * Returns the region where countryId = ? and regionCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 456 * 457 * @param countryId the country ID 458 * @param regionCode the region code 459 * @return the matching region, or <code>null</code> if a matching region could not be found 460 * @throws SystemException if a system exception occurred 461 */ 462 public static com.liferay.portal.model.Region fetchByC_R(long countryId, 463 java.lang.String regionCode) 464 throws com.liferay.portal.kernel.exception.SystemException { 465 return getPersistence().fetchByC_R(countryId, regionCode); 466 } 467 468 /** 469 * Returns the region where countryId = ? and regionCode = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 470 * 471 * @param countryId the country ID 472 * @param regionCode the region code 473 * @param retrieveFromCache whether to use the finder cache 474 * @return the matching region, or <code>null</code> if a matching region could not be found 475 * @throws SystemException if a system exception occurred 476 */ 477 public static com.liferay.portal.model.Region fetchByC_R(long countryId, 478 java.lang.String regionCode, boolean retrieveFromCache) 479 throws com.liferay.portal.kernel.exception.SystemException { 480 return getPersistence() 481 .fetchByC_R(countryId, regionCode, retrieveFromCache); 482 } 483 484 /** 485 * Removes the region where countryId = ? and regionCode = ? from the database. 486 * 487 * @param countryId the country ID 488 * @param regionCode the region code 489 * @return the region that was removed 490 * @throws SystemException if a system exception occurred 491 */ 492 public static com.liferay.portal.model.Region removeByC_R(long countryId, 493 java.lang.String regionCode) 494 throws com.liferay.portal.NoSuchRegionException, 495 com.liferay.portal.kernel.exception.SystemException { 496 return getPersistence().removeByC_R(countryId, regionCode); 497 } 498 499 /** 500 * Returns the number of regions where countryId = ? and regionCode = ?. 501 * 502 * @param countryId the country ID 503 * @param regionCode the region code 504 * @return the number of matching regions 505 * @throws SystemException if a system exception occurred 506 */ 507 public static int countByC_R(long countryId, java.lang.String regionCode) 508 throws com.liferay.portal.kernel.exception.SystemException { 509 return getPersistence().countByC_R(countryId, regionCode); 510 } 511 512 /** 513 * Returns all the regions where countryId = ? and active = ?. 514 * 515 * @param countryId the country ID 516 * @param active the active 517 * @return the matching regions 518 * @throws SystemException if a system exception occurred 519 */ 520 public static java.util.List<com.liferay.portal.model.Region> findByC_A( 521 long countryId, boolean active) 522 throws com.liferay.portal.kernel.exception.SystemException { 523 return getPersistence().findByC_A(countryId, active); 524 } 525 526 /** 527 * Returns a range of all the regions where countryId = ? and active = ?. 528 * 529 * <p> 530 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 531 * </p> 532 * 533 * @param countryId the country ID 534 * @param active the active 535 * @param start the lower bound of the range of regions 536 * @param end the upper bound of the range of regions (not inclusive) 537 * @return the range of matching regions 538 * @throws SystemException if a system exception occurred 539 */ 540 public static java.util.List<com.liferay.portal.model.Region> findByC_A( 541 long countryId, boolean active, int start, int end) 542 throws com.liferay.portal.kernel.exception.SystemException { 543 return getPersistence().findByC_A(countryId, active, start, end); 544 } 545 546 /** 547 * Returns an ordered range of all the regions where countryId = ? and active = ?. 548 * 549 * <p> 550 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 551 * </p> 552 * 553 * @param countryId the country ID 554 * @param active the active 555 * @param start the lower bound of the range of regions 556 * @param end the upper bound of the range of regions (not inclusive) 557 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 558 * @return the ordered range of matching regions 559 * @throws SystemException if a system exception occurred 560 */ 561 public static java.util.List<com.liferay.portal.model.Region> findByC_A( 562 long countryId, boolean active, int start, int end, 563 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 564 throws com.liferay.portal.kernel.exception.SystemException { 565 return getPersistence() 566 .findByC_A(countryId, active, start, end, orderByComparator); 567 } 568 569 /** 570 * Returns the first region in the ordered set where countryId = ? and active = ?. 571 * 572 * @param countryId the country ID 573 * @param active the active 574 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 575 * @return the first matching region 576 * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found 577 * @throws SystemException if a system exception occurred 578 */ 579 public static com.liferay.portal.model.Region findByC_A_First( 580 long countryId, boolean active, 581 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 582 throws com.liferay.portal.NoSuchRegionException, 583 com.liferay.portal.kernel.exception.SystemException { 584 return getPersistence() 585 .findByC_A_First(countryId, active, orderByComparator); 586 } 587 588 /** 589 * Returns the first region in the ordered set where countryId = ? and active = ?. 590 * 591 * @param countryId the country ID 592 * @param active the active 593 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 594 * @return the first matching region, or <code>null</code> if a matching region could not be found 595 * @throws SystemException if a system exception occurred 596 */ 597 public static com.liferay.portal.model.Region fetchByC_A_First( 598 long countryId, boolean active, 599 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 600 throws com.liferay.portal.kernel.exception.SystemException { 601 return getPersistence() 602 .fetchByC_A_First(countryId, active, orderByComparator); 603 } 604 605 /** 606 * Returns the last region in the ordered set where countryId = ? and active = ?. 607 * 608 * @param countryId the country ID 609 * @param active the active 610 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 611 * @return the last matching region 612 * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found 613 * @throws SystemException if a system exception occurred 614 */ 615 public static com.liferay.portal.model.Region findByC_A_Last( 616 long countryId, boolean active, 617 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 618 throws com.liferay.portal.NoSuchRegionException, 619 com.liferay.portal.kernel.exception.SystemException { 620 return getPersistence() 621 .findByC_A_Last(countryId, active, orderByComparator); 622 } 623 624 /** 625 * Returns the last region in the ordered set where countryId = ? and active = ?. 626 * 627 * @param countryId the country ID 628 * @param active the active 629 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 630 * @return the last matching region, or <code>null</code> if a matching region could not be found 631 * @throws SystemException if a system exception occurred 632 */ 633 public static com.liferay.portal.model.Region fetchByC_A_Last( 634 long countryId, boolean active, 635 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 636 throws com.liferay.portal.kernel.exception.SystemException { 637 return getPersistence() 638 .fetchByC_A_Last(countryId, active, orderByComparator); 639 } 640 641 /** 642 * Returns the regions before and after the current region in the ordered set where countryId = ? and active = ?. 643 * 644 * @param regionId the primary key of the current region 645 * @param countryId the country ID 646 * @param active the active 647 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 648 * @return the previous, current, and next region 649 * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found 650 * @throws SystemException if a system exception occurred 651 */ 652 public static com.liferay.portal.model.Region[] findByC_A_PrevAndNext( 653 long regionId, long countryId, boolean active, 654 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 655 throws com.liferay.portal.NoSuchRegionException, 656 com.liferay.portal.kernel.exception.SystemException { 657 return getPersistence() 658 .findByC_A_PrevAndNext(regionId, countryId, active, 659 orderByComparator); 660 } 661 662 /** 663 * Removes all the regions where countryId = ? and active = ? from the database. 664 * 665 * @param countryId the country ID 666 * @param active the active 667 * @throws SystemException if a system exception occurred 668 */ 669 public static void removeByC_A(long countryId, boolean active) 670 throws com.liferay.portal.kernel.exception.SystemException { 671 getPersistence().removeByC_A(countryId, active); 672 } 673 674 /** 675 * Returns the number of regions where countryId = ? and active = ?. 676 * 677 * @param countryId the country ID 678 * @param active the active 679 * @return the number of matching regions 680 * @throws SystemException if a system exception occurred 681 */ 682 public static int countByC_A(long countryId, boolean active) 683 throws com.liferay.portal.kernel.exception.SystemException { 684 return getPersistence().countByC_A(countryId, active); 685 } 686 687 /** 688 * Caches the region in the entity cache if it is enabled. 689 * 690 * @param region the region 691 */ 692 public static void cacheResult(com.liferay.portal.model.Region region) { 693 getPersistence().cacheResult(region); 694 } 695 696 /** 697 * Caches the regions in the entity cache if it is enabled. 698 * 699 * @param regions the regions 700 */ 701 public static void cacheResult( 702 java.util.List<com.liferay.portal.model.Region> regions) { 703 getPersistence().cacheResult(regions); 704 } 705 706 /** 707 * Creates a new region with the primary key. Does not add the region to the database. 708 * 709 * @param regionId the primary key for the new region 710 * @return the new region 711 */ 712 public static com.liferay.portal.model.Region create(long regionId) { 713 return getPersistence().create(regionId); 714 } 715 716 /** 717 * Removes the region with the primary key from the database. Also notifies the appropriate model listeners. 718 * 719 * @param regionId the primary key of the region 720 * @return the region that was removed 721 * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found 722 * @throws SystemException if a system exception occurred 723 */ 724 public static com.liferay.portal.model.Region remove(long regionId) 725 throws com.liferay.portal.NoSuchRegionException, 726 com.liferay.portal.kernel.exception.SystemException { 727 return getPersistence().remove(regionId); 728 } 729 730 public static com.liferay.portal.model.Region updateImpl( 731 com.liferay.portal.model.Region region) 732 throws com.liferay.portal.kernel.exception.SystemException { 733 return getPersistence().updateImpl(region); 734 } 735 736 /** 737 * Returns the region with the primary key or throws a {@link com.liferay.portal.NoSuchRegionException} if it could not be found. 738 * 739 * @param regionId the primary key of the region 740 * @return the region 741 * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found 742 * @throws SystemException if a system exception occurred 743 */ 744 public static com.liferay.portal.model.Region findByPrimaryKey( 745 long regionId) 746 throws com.liferay.portal.NoSuchRegionException, 747 com.liferay.portal.kernel.exception.SystemException { 748 return getPersistence().findByPrimaryKey(regionId); 749 } 750 751 /** 752 * Returns the region with the primary key or returns <code>null</code> if it could not be found. 753 * 754 * @param regionId the primary key of the region 755 * @return the region, or <code>null</code> if a region with the primary key could not be found 756 * @throws SystemException if a system exception occurred 757 */ 758 public static com.liferay.portal.model.Region fetchByPrimaryKey( 759 long regionId) 760 throws com.liferay.portal.kernel.exception.SystemException { 761 return getPersistence().fetchByPrimaryKey(regionId); 762 } 763 764 /** 765 * Returns all the regions. 766 * 767 * @return the regions 768 * @throws SystemException if a system exception occurred 769 */ 770 public static java.util.List<com.liferay.portal.model.Region> findAll() 771 throws com.liferay.portal.kernel.exception.SystemException { 772 return getPersistence().findAll(); 773 } 774 775 /** 776 * Returns a range of all the regions. 777 * 778 * <p> 779 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 780 * </p> 781 * 782 * @param start the lower bound of the range of regions 783 * @param end the upper bound of the range of regions (not inclusive) 784 * @return the range of regions 785 * @throws SystemException if a system exception occurred 786 */ 787 public static java.util.List<com.liferay.portal.model.Region> findAll( 788 int start, int end) 789 throws com.liferay.portal.kernel.exception.SystemException { 790 return getPersistence().findAll(start, end); 791 } 792 793 /** 794 * Returns an ordered range of all the regions. 795 * 796 * <p> 797 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 798 * </p> 799 * 800 * @param start the lower bound of the range of regions 801 * @param end the upper bound of the range of regions (not inclusive) 802 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 803 * @return the ordered range of regions 804 * @throws SystemException if a system exception occurred 805 */ 806 public static java.util.List<com.liferay.portal.model.Region> findAll( 807 int start, int end, 808 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 809 throws com.liferay.portal.kernel.exception.SystemException { 810 return getPersistence().findAll(start, end, orderByComparator); 811 } 812 813 /** 814 * Removes all the regions from the database. 815 * 816 * @throws SystemException if a system exception occurred 817 */ 818 public static void removeAll() 819 throws com.liferay.portal.kernel.exception.SystemException { 820 getPersistence().removeAll(); 821 } 822 823 /** 824 * Returns the number of regions. 825 * 826 * @return the number of regions 827 * @throws SystemException if a system exception occurred 828 */ 829 public static int countAll() 830 throws com.liferay.portal.kernel.exception.SystemException { 831 return getPersistence().countAll(); 832 } 833 834 public static RegionPersistence getPersistence() { 835 if (_persistence == null) { 836 _persistence = (RegionPersistence)PortalBeanLocatorUtil.locate(RegionPersistence.class.getName()); 837 838 ReferenceRegistry.registerReference(RegionUtil.class, "_persistence"); 839 } 840 841 return _persistence; 842 } 843 844 /** 845 * @deprecated As of 6.2.0 846 */ 847 public void setPersistence(RegionPersistence persistence) { 848 } 849 850 private static RegionPersistence _persistence; 851 }