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