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