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