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