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 com.liferay.portal.model.Region create(long regionId) {
30          return getPersistence().create(regionId);
31      }
32  
33      public static com.liferay.portal.model.Region remove(long regionId)
34          throws com.liferay.portal.NoSuchRegionException,
35              com.liferay.portal.SystemException {
36          return getPersistence().remove(regionId);
37      }
38  
39      public static com.liferay.portal.model.Region remove(
40          com.liferay.portal.model.Region region)
41          throws com.liferay.portal.SystemException {
42          return getPersistence().remove(region);
43      }
44  
45      /**
46       * @deprecated Use <code>update(Region region, boolean merge)</code>.
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      /**
55       * Add, update, or merge, the entity. This method also calls the model
56       * listeners to trigger the proper events associated with adding, deleting,
57       * or updating an entity.
58       *
59       * @param        region the entity to add, update, or merge
60       * @param        merge boolean value for whether to merge the entity. The
61       *                default value is false. Setting merge to true is more
62       *                expensive and should only be true when region is
63       *                transient. See LEP-5473 for a detailed discussion of this
64       *                method.
65       * @return        true if the portlet can be displayed via Ajax
66       */
67      public static com.liferay.portal.model.Region update(
68          com.liferay.portal.model.Region region, boolean merge)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(region, merge);
71      }
72  
73      public static com.liferay.portal.model.Region updateImpl(
74          com.liferay.portal.model.Region region, boolean merge)
75          throws com.liferay.portal.SystemException {
76          return getPersistence().updateImpl(region, merge);
77      }
78  
79      public static com.liferay.portal.model.Region findByPrimaryKey(
80          long regionId)
81          throws com.liferay.portal.NoSuchRegionException,
82              com.liferay.portal.SystemException {
83          return getPersistence().findByPrimaryKey(regionId);
84      }
85  
86      public static com.liferay.portal.model.Region fetchByPrimaryKey(
87          long regionId) throws com.liferay.portal.SystemException {
88          return getPersistence().fetchByPrimaryKey(regionId);
89      }
90  
91      public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
92          long countryId) throws com.liferay.portal.SystemException {
93          return getPersistence().findByCountryId(countryId);
94      }
95  
96      public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
97          long countryId, int start, int end)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().findByCountryId(countryId, start, end);
100     }
101 
102     public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
103         long countryId, int start, int end,
104         com.liferay.portal.kernel.util.OrderByComparator obc)
105         throws com.liferay.portal.SystemException {
106         return getPersistence().findByCountryId(countryId, start, end, obc);
107     }
108 
109     public static com.liferay.portal.model.Region findByCountryId_First(
110         long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.NoSuchRegionException,
112             com.liferay.portal.SystemException {
113         return getPersistence().findByCountryId_First(countryId, obc);
114     }
115 
116     public static com.liferay.portal.model.Region findByCountryId_Last(
117         long countryId, com.liferay.portal.kernel.util.OrderByComparator obc)
118         throws com.liferay.portal.NoSuchRegionException,
119             com.liferay.portal.SystemException {
120         return getPersistence().findByCountryId_Last(countryId, obc);
121     }
122 
123     public static com.liferay.portal.model.Region[] findByCountryId_PrevAndNext(
124         long regionId, long countryId,
125         com.liferay.portal.kernel.util.OrderByComparator obc)
126         throws com.liferay.portal.NoSuchRegionException,
127             com.liferay.portal.SystemException {
128         return getPersistence()
129                    .findByCountryId_PrevAndNext(regionId, countryId, obc);
130     }
131 
132     public static java.util.List<com.liferay.portal.model.Region> findByActive(
133         boolean active) throws com.liferay.portal.SystemException {
134         return getPersistence().findByActive(active);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.Region> findByActive(
138         boolean active, int start, int end)
139         throws com.liferay.portal.SystemException {
140         return getPersistence().findByActive(active, start, end);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.Region> findByActive(
144         boolean active, int start, int end,
145         com.liferay.portal.kernel.util.OrderByComparator obc)
146         throws com.liferay.portal.SystemException {
147         return getPersistence().findByActive(active, start, end, obc);
148     }
149 
150     public static com.liferay.portal.model.Region findByActive_First(
151         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.NoSuchRegionException,
153             com.liferay.portal.SystemException {
154         return getPersistence().findByActive_First(active, obc);
155     }
156 
157     public static com.liferay.portal.model.Region findByActive_Last(
158         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.NoSuchRegionException,
160             com.liferay.portal.SystemException {
161         return getPersistence().findByActive_Last(active, obc);
162     }
163 
164     public static com.liferay.portal.model.Region[] findByActive_PrevAndNext(
165         long regionId, boolean active,
166         com.liferay.portal.kernel.util.OrderByComparator obc)
167         throws com.liferay.portal.NoSuchRegionException,
168             com.liferay.portal.SystemException {
169         return getPersistence().findByActive_PrevAndNext(regionId, active, obc);
170     }
171 
172     public static java.util.List<com.liferay.portal.model.Region> findByC_A(
173         long countryId, boolean active)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findByC_A(countryId, active);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.Region> findByC_A(
179         long countryId, boolean active, int start, int end)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().findByC_A(countryId, active, start, end);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Region> findByC_A(
185         long countryId, boolean active, int start, int end,
186         com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.SystemException {
188         return getPersistence().findByC_A(countryId, active, start, end, obc);
189     }
190 
191     public static com.liferay.portal.model.Region findByC_A_First(
192         long countryId, boolean active,
193         com.liferay.portal.kernel.util.OrderByComparator obc)
194         throws com.liferay.portal.NoSuchRegionException,
195             com.liferay.portal.SystemException {
196         return getPersistence().findByC_A_First(countryId, active, obc);
197     }
198 
199     public static com.liferay.portal.model.Region findByC_A_Last(
200         long countryId, boolean active,
201         com.liferay.portal.kernel.util.OrderByComparator obc)
202         throws com.liferay.portal.NoSuchRegionException,
203             com.liferay.portal.SystemException {
204         return getPersistence().findByC_A_Last(countryId, active, obc);
205     }
206 
207     public static com.liferay.portal.model.Region[] findByC_A_PrevAndNext(
208         long regionId, long countryId, boolean active,
209         com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.NoSuchRegionException,
211             com.liferay.portal.SystemException {
212         return getPersistence()
213                    .findByC_A_PrevAndNext(regionId, countryId, active, obc);
214     }
215 
216     public static java.util.List<Object> findWithDynamicQuery(
217         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
218         throws com.liferay.portal.SystemException {
219         return getPersistence().findWithDynamicQuery(dynamicQuery);
220     }
221 
222     public static java.util.List<Object> findWithDynamicQuery(
223         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
224         int end) throws com.liferay.portal.SystemException {
225         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
226     }
227 
228     public static java.util.List<com.liferay.portal.model.Region> findAll()
229         throws com.liferay.portal.SystemException {
230         return getPersistence().findAll();
231     }
232 
233     public static java.util.List<com.liferay.portal.model.Region> findAll(
234         int start, int end) throws com.liferay.portal.SystemException {
235         return getPersistence().findAll(start, end);
236     }
237 
238     public static java.util.List<com.liferay.portal.model.Region> findAll(
239         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
240         throws com.liferay.portal.SystemException {
241         return getPersistence().findAll(start, end, obc);
242     }
243 
244     public static void removeByCountryId(long countryId)
245         throws com.liferay.portal.SystemException {
246         getPersistence().removeByCountryId(countryId);
247     }
248 
249     public static void removeByActive(boolean active)
250         throws com.liferay.portal.SystemException {
251         getPersistence().removeByActive(active);
252     }
253 
254     public static void removeByC_A(long countryId, boolean active)
255         throws com.liferay.portal.SystemException {
256         getPersistence().removeByC_A(countryId, active);
257     }
258 
259     public static void removeAll() throws com.liferay.portal.SystemException {
260         getPersistence().removeAll();
261     }
262 
263     public static int countByCountryId(long countryId)
264         throws com.liferay.portal.SystemException {
265         return getPersistence().countByCountryId(countryId);
266     }
267 
268     public static int countByActive(boolean active)
269         throws com.liferay.portal.SystemException {
270         return getPersistence().countByActive(active);
271     }
272 
273     public static int countByC_A(long countryId, boolean active)
274         throws com.liferay.portal.SystemException {
275         return getPersistence().countByC_A(countryId, active);
276     }
277 
278     public static int countAll() throws com.liferay.portal.SystemException {
279         return getPersistence().countAll();
280     }
281 
282     public static RegionPersistence getPersistence() {
283         return _persistence;
284     }
285 
286     public void setPersistence(RegionPersistence persistence) {
287         _persistence = persistence;
288     }
289 
290     private static RegionPersistence _persistence;
291 }