1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.Country;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="CountryUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       CountryPersistence
35   * @see       CountryPersistenceImpl
36   * @generated
37   */
38  public class CountryUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(Country)
48       */
49      public static void clearCache(Country country) {
50          getPersistence().clearCache(country);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static Country remove(Country country) throws SystemException {
81          return getPersistence().remove(country);
82      }
83  
84      /**
85       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
86       */
87      public static Country update(Country country, boolean merge)
88          throws SystemException {
89          return getPersistence().update(country, merge);
90      }
91  
92      public static void cacheResult(com.liferay.portal.model.Country country) {
93          getPersistence().cacheResult(country);
94      }
95  
96      public static void cacheResult(
97          java.util.List<com.liferay.portal.model.Country> countries) {
98          getPersistence().cacheResult(countries);
99      }
100 
101     public static com.liferay.portal.model.Country create(long countryId) {
102         return getPersistence().create(countryId);
103     }
104 
105     public static com.liferay.portal.model.Country remove(long countryId)
106         throws com.liferay.portal.NoSuchCountryException,
107             com.liferay.portal.SystemException {
108         return getPersistence().remove(countryId);
109     }
110 
111     /**
112      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
113      */
114     public static com.liferay.portal.model.Country update(
115         com.liferay.portal.model.Country country)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().update(country);
118     }
119 
120     public static com.liferay.portal.model.Country updateImpl(
121         com.liferay.portal.model.Country country, boolean merge)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().updateImpl(country, merge);
124     }
125 
126     public static com.liferay.portal.model.Country findByPrimaryKey(
127         long countryId)
128         throws com.liferay.portal.NoSuchCountryException,
129             com.liferay.portal.SystemException {
130         return getPersistence().findByPrimaryKey(countryId);
131     }
132 
133     public static com.liferay.portal.model.Country fetchByPrimaryKey(
134         long countryId) throws com.liferay.portal.SystemException {
135         return getPersistence().fetchByPrimaryKey(countryId);
136     }
137 
138     public static com.liferay.portal.model.Country findByName(
139         java.lang.String name)
140         throws com.liferay.portal.NoSuchCountryException,
141             com.liferay.portal.SystemException {
142         return getPersistence().findByName(name);
143     }
144 
145     public static com.liferay.portal.model.Country fetchByName(
146         java.lang.String name) throws com.liferay.portal.SystemException {
147         return getPersistence().fetchByName(name);
148     }
149 
150     public static com.liferay.portal.model.Country fetchByName(
151         java.lang.String name, boolean retrieveFromCache)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().fetchByName(name, retrieveFromCache);
154     }
155 
156     public static com.liferay.portal.model.Country findByA2(java.lang.String a2)
157         throws com.liferay.portal.NoSuchCountryException,
158             com.liferay.portal.SystemException {
159         return getPersistence().findByA2(a2);
160     }
161 
162     public static com.liferay.portal.model.Country fetchByA2(
163         java.lang.String a2) throws com.liferay.portal.SystemException {
164         return getPersistence().fetchByA2(a2);
165     }
166 
167     public static com.liferay.portal.model.Country fetchByA2(
168         java.lang.String a2, boolean retrieveFromCache)
169         throws com.liferay.portal.SystemException {
170         return getPersistence().fetchByA2(a2, retrieveFromCache);
171     }
172 
173     public static com.liferay.portal.model.Country findByA3(java.lang.String a3)
174         throws com.liferay.portal.NoSuchCountryException,
175             com.liferay.portal.SystemException {
176         return getPersistence().findByA3(a3);
177     }
178 
179     public static com.liferay.portal.model.Country fetchByA3(
180         java.lang.String a3) throws com.liferay.portal.SystemException {
181         return getPersistence().fetchByA3(a3);
182     }
183 
184     public static com.liferay.portal.model.Country fetchByA3(
185         java.lang.String a3, boolean retrieveFromCache)
186         throws com.liferay.portal.SystemException {
187         return getPersistence().fetchByA3(a3, retrieveFromCache);
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Country> findByActive(
191         boolean active) throws com.liferay.portal.SystemException {
192         return getPersistence().findByActive(active);
193     }
194 
195     public static java.util.List<com.liferay.portal.model.Country> findByActive(
196         boolean active, int start, int end)
197         throws com.liferay.portal.SystemException {
198         return getPersistence().findByActive(active, start, end);
199     }
200 
201     public static java.util.List<com.liferay.portal.model.Country> findByActive(
202         boolean active, int start, int end,
203         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204         throws com.liferay.portal.SystemException {
205         return getPersistence()
206                    .findByActive(active, start, end, orderByComparator);
207     }
208 
209     public static com.liferay.portal.model.Country findByActive_First(
210         boolean active,
211         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
212         throws com.liferay.portal.NoSuchCountryException,
213             com.liferay.portal.SystemException {
214         return getPersistence().findByActive_First(active, orderByComparator);
215     }
216 
217     public static com.liferay.portal.model.Country findByActive_Last(
218         boolean active,
219         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
220         throws com.liferay.portal.NoSuchCountryException,
221             com.liferay.portal.SystemException {
222         return getPersistence().findByActive_Last(active, orderByComparator);
223     }
224 
225     public static com.liferay.portal.model.Country[] findByActive_PrevAndNext(
226         long countryId, boolean active,
227         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
228         throws com.liferay.portal.NoSuchCountryException,
229             com.liferay.portal.SystemException {
230         return getPersistence()
231                    .findByActive_PrevAndNext(countryId, active,
232             orderByComparator);
233     }
234 
235     public static java.util.List<com.liferay.portal.model.Country> findAll()
236         throws com.liferay.portal.SystemException {
237         return getPersistence().findAll();
238     }
239 
240     public static java.util.List<com.liferay.portal.model.Country> findAll(
241         int start, int end) throws com.liferay.portal.SystemException {
242         return getPersistence().findAll(start, end);
243     }
244 
245     public static java.util.List<com.liferay.portal.model.Country> findAll(
246         int start, int end,
247         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248         throws com.liferay.portal.SystemException {
249         return getPersistence().findAll(start, end, orderByComparator);
250     }
251 
252     public static void removeByName(java.lang.String name)
253         throws com.liferay.portal.NoSuchCountryException,
254             com.liferay.portal.SystemException {
255         getPersistence().removeByName(name);
256     }
257 
258     public static void removeByA2(java.lang.String a2)
259         throws com.liferay.portal.NoSuchCountryException,
260             com.liferay.portal.SystemException {
261         getPersistence().removeByA2(a2);
262     }
263 
264     public static void removeByA3(java.lang.String a3)
265         throws com.liferay.portal.NoSuchCountryException,
266             com.liferay.portal.SystemException {
267         getPersistence().removeByA3(a3);
268     }
269 
270     public static void removeByActive(boolean active)
271         throws com.liferay.portal.SystemException {
272         getPersistence().removeByActive(active);
273     }
274 
275     public static void removeAll() throws com.liferay.portal.SystemException {
276         getPersistence().removeAll();
277     }
278 
279     public static int countByName(java.lang.String name)
280         throws com.liferay.portal.SystemException {
281         return getPersistence().countByName(name);
282     }
283 
284     public static int countByA2(java.lang.String a2)
285         throws com.liferay.portal.SystemException {
286         return getPersistence().countByA2(a2);
287     }
288 
289     public static int countByA3(java.lang.String a3)
290         throws com.liferay.portal.SystemException {
291         return getPersistence().countByA3(a3);
292     }
293 
294     public static int countByActive(boolean active)
295         throws com.liferay.portal.SystemException {
296         return getPersistence().countByActive(active);
297     }
298 
299     public static int countAll() throws com.liferay.portal.SystemException {
300         return getPersistence().countAll();
301     }
302 
303     public static CountryPersistence getPersistence() {
304         if (_persistence == null) {
305             _persistence = (CountryPersistence)PortalBeanLocatorUtil.locate(CountryPersistence.class.getName());
306 
307             ReferenceRegistry.registerReference(CountryUtil.class,
308                 "_persistence");
309         }
310 
311         return _persistence;
312     }
313 
314     public void setPersistence(CountryPersistence persistence) {
315         _persistence = persistence;
316 
317         ReferenceRegistry.registerReference(CountryUtil.class, "_persistence");
318     }
319 
320     private static CountryPersistence _persistence;
321 }