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