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