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="CountryUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class CountryUtil {
29      public static com.liferay.portal.model.Country create(long countryId) {
30          return getPersistence().create(countryId);
31      }
32  
33      public static com.liferay.portal.model.Country remove(long countryId)
34          throws com.liferay.portal.NoSuchCountryException,
35              com.liferay.portal.SystemException {
36          return getPersistence().remove(countryId);
37      }
38  
39      public static com.liferay.portal.model.Country remove(
40          com.liferay.portal.model.Country country)
41          throws com.liferay.portal.SystemException {
42          return getPersistence().remove(country);
43      }
44  
45      /**
46       * @deprecated Use <code>update(Country country, boolean merge)</code>.
47       */
48      public static com.liferay.portal.model.Country update(
49          com.liferay.portal.model.Country country)
50          throws com.liferay.portal.SystemException {
51          return getPersistence().update(country);
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        country 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 country 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.Country update(
68          com.liferay.portal.model.Country country, boolean merge)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(country, merge);
71      }
72  
73      public static com.liferay.portal.model.Country updateImpl(
74          com.liferay.portal.model.Country country, boolean merge)
75          throws com.liferay.portal.SystemException {
76          return getPersistence().updateImpl(country, merge);
77      }
78  
79      public static com.liferay.portal.model.Country findByPrimaryKey(
80          long countryId)
81          throws com.liferay.portal.NoSuchCountryException,
82              com.liferay.portal.SystemException {
83          return getPersistence().findByPrimaryKey(countryId);
84      }
85  
86      public static com.liferay.portal.model.Country fetchByPrimaryKey(
87          long countryId) throws com.liferay.portal.SystemException {
88          return getPersistence().fetchByPrimaryKey(countryId);
89      }
90  
91      public static com.liferay.portal.model.Country findByName(
92          java.lang.String name)
93          throws com.liferay.portal.NoSuchCountryException,
94              com.liferay.portal.SystemException {
95          return getPersistence().findByName(name);
96      }
97  
98      public static com.liferay.portal.model.Country fetchByName(
99          java.lang.String name) throws com.liferay.portal.SystemException {
100         return getPersistence().fetchByName(name);
101     }
102 
103     public static com.liferay.portal.model.Country findByA2(java.lang.String a2)
104         throws com.liferay.portal.NoSuchCountryException,
105             com.liferay.portal.SystemException {
106         return getPersistence().findByA2(a2);
107     }
108 
109     public static com.liferay.portal.model.Country fetchByA2(
110         java.lang.String a2) throws com.liferay.portal.SystemException {
111         return getPersistence().fetchByA2(a2);
112     }
113 
114     public static com.liferay.portal.model.Country findByA3(java.lang.String a3)
115         throws com.liferay.portal.NoSuchCountryException,
116             com.liferay.portal.SystemException {
117         return getPersistence().findByA3(a3);
118     }
119 
120     public static com.liferay.portal.model.Country fetchByA3(
121         java.lang.String a3) throws com.liferay.portal.SystemException {
122         return getPersistence().fetchByA3(a3);
123     }
124 
125     public static java.util.List<com.liferay.portal.model.Country> findByActive(
126         boolean active) throws com.liferay.portal.SystemException {
127         return getPersistence().findByActive(active);
128     }
129 
130     public static java.util.List<com.liferay.portal.model.Country> findByActive(
131         boolean active, int start, int end)
132         throws com.liferay.portal.SystemException {
133         return getPersistence().findByActive(active, start, end);
134     }
135 
136     public static java.util.List<com.liferay.portal.model.Country> findByActive(
137         boolean active, int start, int end,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.SystemException {
140         return getPersistence().findByActive(active, start, end, obc);
141     }
142 
143     public static com.liferay.portal.model.Country findByActive_First(
144         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.NoSuchCountryException,
146             com.liferay.portal.SystemException {
147         return getPersistence().findByActive_First(active, obc);
148     }
149 
150     public static com.liferay.portal.model.Country findByActive_Last(
151         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.NoSuchCountryException,
153             com.liferay.portal.SystemException {
154         return getPersistence().findByActive_Last(active, obc);
155     }
156 
157     public static com.liferay.portal.model.Country[] findByActive_PrevAndNext(
158         long countryId, boolean active,
159         com.liferay.portal.kernel.util.OrderByComparator obc)
160         throws com.liferay.portal.NoSuchCountryException,
161             com.liferay.portal.SystemException {
162         return getPersistence().findByActive_PrevAndNext(countryId, active, obc);
163     }
164 
165     public static java.util.List<Object> findWithDynamicQuery(
166         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167         throws com.liferay.portal.SystemException {
168         return getPersistence().findWithDynamicQuery(dynamicQuery);
169     }
170 
171     public static java.util.List<Object> findWithDynamicQuery(
172         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
173         int end) throws com.liferay.portal.SystemException {
174         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
175     }
176 
177     public static java.util.List<com.liferay.portal.model.Country> findAll()
178         throws com.liferay.portal.SystemException {
179         return getPersistence().findAll();
180     }
181 
182     public static java.util.List<com.liferay.portal.model.Country> findAll(
183         int start, int end) throws com.liferay.portal.SystemException {
184         return getPersistence().findAll(start, end);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Country> findAll(
188         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
189         throws com.liferay.portal.SystemException {
190         return getPersistence().findAll(start, end, obc);
191     }
192 
193     public static void removeByName(java.lang.String name)
194         throws com.liferay.portal.NoSuchCountryException,
195             com.liferay.portal.SystemException {
196         getPersistence().removeByName(name);
197     }
198 
199     public static void removeByA2(java.lang.String a2)
200         throws com.liferay.portal.NoSuchCountryException,
201             com.liferay.portal.SystemException {
202         getPersistence().removeByA2(a2);
203     }
204 
205     public static void removeByA3(java.lang.String a3)
206         throws com.liferay.portal.NoSuchCountryException,
207             com.liferay.portal.SystemException {
208         getPersistence().removeByA3(a3);
209     }
210 
211     public static void removeByActive(boolean active)
212         throws com.liferay.portal.SystemException {
213         getPersistence().removeByActive(active);
214     }
215 
216     public static void removeAll() throws com.liferay.portal.SystemException {
217         getPersistence().removeAll();
218     }
219 
220     public static int countByName(java.lang.String name)
221         throws com.liferay.portal.SystemException {
222         return getPersistence().countByName(name);
223     }
224 
225     public static int countByA2(java.lang.String a2)
226         throws com.liferay.portal.SystemException {
227         return getPersistence().countByA2(a2);
228     }
229 
230     public static int countByA3(java.lang.String a3)
231         throws com.liferay.portal.SystemException {
232         return getPersistence().countByA3(a3);
233     }
234 
235     public static int countByActive(boolean active)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().countByActive(active);
238     }
239 
240     public static int countAll() throws com.liferay.portal.SystemException {
241         return getPersistence().countAll();
242     }
243 
244     public static CountryPersistence getPersistence() {
245         return _persistence;
246     }
247 
248     public void setPersistence(CountryPersistence persistence) {
249         _persistence = persistence;
250     }
251 
252     private static CountryPersistence _persistence;
253 }