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