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