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