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