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