1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="RegionUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class RegionUtil {
32      public static com.liferay.portal.model.Region create(long regionId) {
33          return getPersistence().create(regionId);
34      }
35  
36      public static com.liferay.portal.model.Region remove(long regionId)
37          throws com.liferay.portal.NoSuchRegionException,
38              com.liferay.portal.SystemException {
39          return getPersistence().remove(regionId);
40      }
41  
42      public static com.liferay.portal.model.Region remove(
43          com.liferay.portal.model.Region region)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(region);
46      }
47  
48      /**
49       * @deprecated Use <code>update(Region region, boolean merge)</code>.
50       */
51      public static com.liferay.portal.model.Region update(
52          com.liferay.portal.model.Region region)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(region);
55      }
56  
57      /**
58       * Add, update, or merge, the entity. This method also calls the model
59       * listeners to trigger the proper events associated with adding, deleting,
60       * or updating an entity.
61       *
62       * @param        region the entity to add, update, or merge
63       * @param        merge boolean value for whether to merge the entity. The
64       *                default value is false. Setting merge to true is more
65       *                expensive and should only be true when region is
66       *                transient. See LEP-5473 for a detailed discussion of this
67       *                method.
68       * @return        true if the portlet can be displayed via Ajax
69       */
70      public static com.liferay.portal.model.Region update(
71          com.liferay.portal.model.Region region, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(region, merge);
74      }
75  
76      public static com.liferay.portal.model.Region updateImpl(
77          com.liferay.portal.model.Region region, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(region, merge);
80      }
81  
82      public static com.liferay.portal.model.Region findByPrimaryKey(
83          long regionId)
84          throws com.liferay.portal.NoSuchRegionException,
85              com.liferay.portal.SystemException {
86          return getPersistence().findByPrimaryKey(regionId);
87      }
88  
89      public static com.liferay.portal.model.Region fetchByPrimaryKey(
90          long regionId) throws com.liferay.portal.SystemException {
91          return getPersistence().fetchByPrimaryKey(regionId);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
95          long countryId) throws com.liferay.portal.SystemException {
96          return getPersistence().findByCountryId(countryId);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
100         long countryId, int start, int end)
101         throws com.liferay.portal.SystemException {
102         return getPersistence().findByCountryId(countryId, start, end);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
106         long countryId, int start, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findByCountryId(countryId, start, end, obc);
110     }
111 
112     public static com.liferay.portal.model.Region findByCountryId_First(
113         long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
114         throws com.liferay.portal.NoSuchRegionException,
115             com.liferay.portal.SystemException {
116         return getPersistence().findByCountryId_First(countryId, obc);
117     }
118 
119     public static com.liferay.portal.model.Region findByCountryId_Last(
120         long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.NoSuchRegionException,
122             com.liferay.portal.SystemException {
123         return getPersistence().findByCountryId_Last(countryId, obc);
124     }
125 
126     public static com.liferay.portal.model.Region[] findByCountryId_PrevAndNext(
127         long regionId, long countryId,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.NoSuchRegionException,
130             com.liferay.portal.SystemException {
131         return getPersistence()
132                    .findByCountryId_PrevAndNext(regionId, countryId, obc);
133     }
134 
135     public static java.util.List<com.liferay.portal.model.Region> findByActive(
136         boolean active) throws com.liferay.portal.SystemException {
137         return getPersistence().findByActive(active);
138     }
139 
140     public static java.util.List<com.liferay.portal.model.Region> findByActive(
141         boolean active, int start, int end)
142         throws com.liferay.portal.SystemException {
143         return getPersistence().findByActive(active, start, end);
144     }
145 
146     public static java.util.List<com.liferay.portal.model.Region> findByActive(
147         boolean active, int start, int end,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.SystemException {
150         return getPersistence().findByActive(active, start, end, obc);
151     }
152 
153     public static com.liferay.portal.model.Region findByActive_First(
154         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
155         throws com.liferay.portal.NoSuchRegionException,
156             com.liferay.portal.SystemException {
157         return getPersistence().findByActive_First(active, obc);
158     }
159 
160     public static com.liferay.portal.model.Region findByActive_Last(
161         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.NoSuchRegionException,
163             com.liferay.portal.SystemException {
164         return getPersistence().findByActive_Last(active, obc);
165     }
166 
167     public static com.liferay.portal.model.Region[] findByActive_PrevAndNext(
168         long regionId, boolean active,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.NoSuchRegionException,
171             com.liferay.portal.SystemException {
172         return getPersistence().findByActive_PrevAndNext(regionId, active, obc);
173     }
174 
175     public static java.util.List<com.liferay.portal.model.Region> findByC_A(
176         long countryId, boolean active)
177         throws com.liferay.portal.SystemException {
178         return getPersistence().findByC_A(countryId, active);
179     }
180 
181     public static java.util.List<com.liferay.portal.model.Region> findByC_A(
182         long countryId, boolean active, int start, int end)
183         throws com.liferay.portal.SystemException {
184         return getPersistence().findByC_A(countryId, active, start, end);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Region> findByC_A(
188         long countryId, boolean active, int start, int end,
189         com.liferay.portal.kernel.util.OrderByComparator obc)
190         throws com.liferay.portal.SystemException {
191         return getPersistence().findByC_A(countryId, active, start, end, obc);
192     }
193 
194     public static com.liferay.portal.model.Region findByC_A_First(
195         long countryId, boolean active,
196         com.liferay.portal.kernel.util.OrderByComparator obc)
197         throws com.liferay.portal.NoSuchRegionException,
198             com.liferay.portal.SystemException {
199         return getPersistence().findByC_A_First(countryId, active, obc);
200     }
201 
202     public static com.liferay.portal.model.Region findByC_A_Last(
203         long countryId, boolean active,
204         com.liferay.portal.kernel.util.OrderByComparator obc)
205         throws com.liferay.portal.NoSuchRegionException,
206             com.liferay.portal.SystemException {
207         return getPersistence().findByC_A_Last(countryId, active, obc);
208     }
209 
210     public static com.liferay.portal.model.Region[] findByC_A_PrevAndNext(
211         long regionId, long countryId, boolean active,
212         com.liferay.portal.kernel.util.OrderByComparator obc)
213         throws com.liferay.portal.NoSuchRegionException,
214             com.liferay.portal.SystemException {
215         return getPersistence()
216                    .findByC_A_PrevAndNext(regionId, countryId, active, obc);
217     }
218 
219     public static java.util.List<Object> findWithDynamicQuery(
220         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
221         throws com.liferay.portal.SystemException {
222         return getPersistence().findWithDynamicQuery(dynamicQuery);
223     }
224 
225     public static java.util.List<Object> findWithDynamicQuery(
226         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
227         int end) throws com.liferay.portal.SystemException {
228         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
229     }
230 
231     public static java.util.List<com.liferay.portal.model.Region> findAll()
232         throws com.liferay.portal.SystemException {
233         return getPersistence().findAll();
234     }
235 
236     public static java.util.List<com.liferay.portal.model.Region> findAll(
237         int start, int end) throws com.liferay.portal.SystemException {
238         return getPersistence().findAll(start, end);
239     }
240 
241     public static java.util.List<com.liferay.portal.model.Region> findAll(
242         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
243         throws com.liferay.portal.SystemException {
244         return getPersistence().findAll(start, end, obc);
245     }
246 
247     public static void removeByCountryId(long countryId)
248         throws com.liferay.portal.SystemException {
249         getPersistence().removeByCountryId(countryId);
250     }
251 
252     public static void removeByActive(boolean active)
253         throws com.liferay.portal.SystemException {
254         getPersistence().removeByActive(active);
255     }
256 
257     public static void removeByC_A(long countryId, boolean active)
258         throws com.liferay.portal.SystemException {
259         getPersistence().removeByC_A(countryId, active);
260     }
261 
262     public static void removeAll() throws com.liferay.portal.SystemException {
263         getPersistence().removeAll();
264     }
265 
266     public static int countByCountryId(long countryId)
267         throws com.liferay.portal.SystemException {
268         return getPersistence().countByCountryId(countryId);
269     }
270 
271     public static int countByActive(boolean active)
272         throws com.liferay.portal.SystemException {
273         return getPersistence().countByActive(active);
274     }
275 
276     public static int countByC_A(long countryId, boolean active)
277         throws com.liferay.portal.SystemException {
278         return getPersistence().countByC_A(countryId, active);
279     }
280 
281     public static int countAll() throws com.liferay.portal.SystemException {
282         return getPersistence().countAll();
283     }
284 
285     public static RegionPersistence getPersistence() {
286         return _persistence;
287     }
288 
289     public void setPersistence(RegionPersistence persistence) {
290         _persistence = persistence;
291     }
292 
293     private static RegionPersistence _persistence;
294 }