1   /**
2    * Copyright (c) 2000-2008 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.SystemException, 
38              com.liferay.portal.NoSuchRegionException {
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      public static com.liferay.portal.model.Region update(
49          com.liferay.portal.model.Region region)
50          throws com.liferay.portal.SystemException {
51          return getPersistence().update(region);
52      }
53  
54      public static com.liferay.portal.model.Region update(
55          com.liferay.portal.model.Region region, boolean merge)
56          throws com.liferay.portal.SystemException {
57          return getPersistence().update(region, merge);
58      }
59  
60      public static com.liferay.portal.model.Region updateImpl(
61          com.liferay.portal.model.Region region, boolean merge)
62          throws com.liferay.portal.SystemException {
63          return getPersistence().updateImpl(region, merge);
64      }
65  
66      public static com.liferay.portal.model.Region findByPrimaryKey(
67          long regionId)
68          throws com.liferay.portal.SystemException, 
69              com.liferay.portal.NoSuchRegionException {
70          return getPersistence().findByPrimaryKey(regionId);
71      }
72  
73      public static com.liferay.portal.model.Region fetchByPrimaryKey(
74          long regionId) throws com.liferay.portal.SystemException {
75          return getPersistence().fetchByPrimaryKey(regionId);
76      }
77  
78      public static java.util.List findByCountryId(long countryId)
79          throws com.liferay.portal.SystemException {
80          return getPersistence().findByCountryId(countryId);
81      }
82  
83      public static java.util.List findByCountryId(long countryId, int begin,
84          int end) throws com.liferay.portal.SystemException {
85          return getPersistence().findByCountryId(countryId, begin, end);
86      }
87  
88      public static java.util.List findByCountryId(long countryId, int begin,
89          int end, com.liferay.portal.kernel.util.OrderByComparator obc)
90          throws com.liferay.portal.SystemException {
91          return getPersistence().findByCountryId(countryId, begin, end, obc);
92      }
93  
94      public static com.liferay.portal.model.Region findByCountryId_First(
95          long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.SystemException, 
97              com.liferay.portal.NoSuchRegionException {
98          return getPersistence().findByCountryId_First(countryId, obc);
99      }
100 
101     public static com.liferay.portal.model.Region findByCountryId_Last(
102         long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
103         throws com.liferay.portal.SystemException, 
104             com.liferay.portal.NoSuchRegionException {
105         return getPersistence().findByCountryId_Last(countryId, obc);
106     }
107 
108     public static com.liferay.portal.model.Region[] findByCountryId_PrevAndNext(
109         long regionId, long countryId,
110         com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.SystemException, 
112             com.liferay.portal.NoSuchRegionException {
113         return getPersistence().findByCountryId_PrevAndNext(regionId,
114             countryId, obc);
115     }
116 
117     public static java.util.List findByActive(boolean active)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().findByActive(active);
120     }
121 
122     public static java.util.List findByActive(boolean active, int begin, int end)
123         throws com.liferay.portal.SystemException {
124         return getPersistence().findByActive(active, begin, end);
125     }
126 
127     public static java.util.List findByActive(boolean active, int begin,
128         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException {
130         return getPersistence().findByActive(active, begin, end, obc);
131     }
132 
133     public static com.liferay.portal.model.Region findByActive_First(
134         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
135         throws com.liferay.portal.SystemException, 
136             com.liferay.portal.NoSuchRegionException {
137         return getPersistence().findByActive_First(active, obc);
138     }
139 
140     public static com.liferay.portal.model.Region findByActive_Last(
141         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException, 
143             com.liferay.portal.NoSuchRegionException {
144         return getPersistence().findByActive_Last(active, obc);
145     }
146 
147     public static com.liferay.portal.model.Region[] findByActive_PrevAndNext(
148         long regionId, boolean active,
149         com.liferay.portal.kernel.util.OrderByComparator obc)
150         throws com.liferay.portal.SystemException, 
151             com.liferay.portal.NoSuchRegionException {
152         return getPersistence().findByActive_PrevAndNext(regionId, active, obc);
153     }
154 
155     public static java.util.List findByC_A(long countryId, boolean active)
156         throws com.liferay.portal.SystemException {
157         return getPersistence().findByC_A(countryId, active);
158     }
159 
160     public static java.util.List findByC_A(long countryId, boolean active,
161         int begin, int end) throws com.liferay.portal.SystemException {
162         return getPersistence().findByC_A(countryId, active, begin, end);
163     }
164 
165     public static java.util.List findByC_A(long countryId, boolean active,
166         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
167         throws com.liferay.portal.SystemException {
168         return getPersistence().findByC_A(countryId, active, begin, end, obc);
169     }
170 
171     public static com.liferay.portal.model.Region findByC_A_First(
172         long countryId, boolean active,
173         com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.SystemException, 
175             com.liferay.portal.NoSuchRegionException {
176         return getPersistence().findByC_A_First(countryId, active, obc);
177     }
178 
179     public static com.liferay.portal.model.Region findByC_A_Last(
180         long countryId, boolean active,
181         com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.SystemException, 
183             com.liferay.portal.NoSuchRegionException {
184         return getPersistence().findByC_A_Last(countryId, active, obc);
185     }
186 
187     public static com.liferay.portal.model.Region[] findByC_A_PrevAndNext(
188         long regionId, long countryId, boolean active,
189         com.liferay.portal.kernel.util.OrderByComparator obc)
190         throws com.liferay.portal.SystemException, 
191             com.liferay.portal.NoSuchRegionException {
192         return getPersistence().findByC_A_PrevAndNext(regionId, countryId,
193             active, obc);
194     }
195 
196     public static java.util.List findWithDynamicQuery(
197         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
198         throws com.liferay.portal.SystemException {
199         return getPersistence().findWithDynamicQuery(queryInitializer);
200     }
201 
202     public static java.util.List findWithDynamicQuery(
203         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
204         int begin, int end) throws com.liferay.portal.SystemException {
205         return getPersistence().findWithDynamicQuery(queryInitializer, begin,
206             end);
207     }
208 
209     public static java.util.List findAll()
210         throws com.liferay.portal.SystemException {
211         return getPersistence().findAll();
212     }
213 
214     public static java.util.List findAll(int begin, int end)
215         throws com.liferay.portal.SystemException {
216         return getPersistence().findAll(begin, end);
217     }
218 
219     public static java.util.List findAll(int begin, int end,
220         com.liferay.portal.kernel.util.OrderByComparator obc)
221         throws com.liferay.portal.SystemException {
222         return getPersistence().findAll(begin, end, obc);
223     }
224 
225     public static void removeByCountryId(long countryId)
226         throws com.liferay.portal.SystemException {
227         getPersistence().removeByCountryId(countryId);
228     }
229 
230     public static void removeByActive(boolean active)
231         throws com.liferay.portal.SystemException {
232         getPersistence().removeByActive(active);
233     }
234 
235     public static void removeByC_A(long countryId, boolean active)
236         throws com.liferay.portal.SystemException {
237         getPersistence().removeByC_A(countryId, active);
238     }
239 
240     public static void removeAll() throws com.liferay.portal.SystemException {
241         getPersistence().removeAll();
242     }
243 
244     public static int countByCountryId(long countryId)
245         throws com.liferay.portal.SystemException {
246         return getPersistence().countByCountryId(countryId);
247     }
248 
249     public static int countByActive(boolean active)
250         throws com.liferay.portal.SystemException {
251         return getPersistence().countByActive(active);
252     }
253 
254     public static int countByC_A(long countryId, boolean active)
255         throws com.liferay.portal.SystemException {
256         return getPersistence().countByC_A(countryId, active);
257     }
258 
259     public static int countAll() throws com.liferay.portal.SystemException {
260         return getPersistence().countAll();
261     }
262 
263     public static RegionPersistence getPersistence() {
264         return _getUtil()._persistence;
265     }
266 
267     public void setPersistence(RegionPersistence persistence) {
268         _persistence = persistence;
269     }
270 
271     private static RegionUtil _getUtil() {
272         if (_util == null) {
273             _util = (RegionUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
274         }
275 
276         return _util;
277     }
278 
279     private static final String _UTIL = RegionUtil.class.getName();
280     private static RegionUtil _util;
281     private RegionPersistence _persistence;
282 }