1   /**
2    * Copyright (c) 2000-2008 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.SystemException, 
38              com.liferay.portal.NoSuchCountryException {
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      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      public static com.liferay.portal.model.Country update(
55          com.liferay.portal.model.Country country, boolean merge)
56          throws com.liferay.portal.SystemException {
57          return getPersistence().update(country, merge);
58      }
59  
60      public static com.liferay.portal.model.Country updateImpl(
61          com.liferay.portal.model.Country country, boolean merge)
62          throws com.liferay.portal.SystemException {
63          return getPersistence().updateImpl(country, merge);
64      }
65  
66      public static com.liferay.portal.model.Country findByPrimaryKey(
67          long countryId)
68          throws com.liferay.portal.SystemException, 
69              com.liferay.portal.NoSuchCountryException {
70          return getPersistence().findByPrimaryKey(countryId);
71      }
72  
73      public static com.liferay.portal.model.Country fetchByPrimaryKey(
74          long countryId) throws com.liferay.portal.SystemException {
75          return getPersistence().fetchByPrimaryKey(countryId);
76      }
77  
78      public static java.util.List findByActive(boolean active)
79          throws com.liferay.portal.SystemException {
80          return getPersistence().findByActive(active);
81      }
82  
83      public static java.util.List findByActive(boolean active, int begin, int end)
84          throws com.liferay.portal.SystemException {
85          return getPersistence().findByActive(active, begin, end);
86      }
87  
88      public static java.util.List findByActive(boolean active, int begin,
89          int end, com.liferay.portal.kernel.util.OrderByComparator obc)
90          throws com.liferay.portal.SystemException {
91          return getPersistence().findByActive(active, begin, end, obc);
92      }
93  
94      public static com.liferay.portal.model.Country findByActive_First(
95          boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.SystemException, 
97              com.liferay.portal.NoSuchCountryException {
98          return getPersistence().findByActive_First(active, obc);
99      }
100 
101     public static com.liferay.portal.model.Country findByActive_Last(
102         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
103         throws com.liferay.portal.SystemException, 
104             com.liferay.portal.NoSuchCountryException {
105         return getPersistence().findByActive_Last(active, obc);
106     }
107 
108     public static com.liferay.portal.model.Country[] findByActive_PrevAndNext(
109         long countryId, boolean active,
110         com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.SystemException, 
112             com.liferay.portal.NoSuchCountryException {
113         return getPersistence().findByActive_PrevAndNext(countryId, active, obc);
114     }
115 
116     public static java.util.List findWithDynamicQuery(
117         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().findWithDynamicQuery(queryInitializer);
120     }
121 
122     public static java.util.List findWithDynamicQuery(
123         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
124         int begin, int end) throws com.liferay.portal.SystemException {
125         return getPersistence().findWithDynamicQuery(queryInitializer, begin,
126             end);
127     }
128 
129     public static java.util.List findAll()
130         throws com.liferay.portal.SystemException {
131         return getPersistence().findAll();
132     }
133 
134     public static java.util.List findAll(int begin, int end)
135         throws com.liferay.portal.SystemException {
136         return getPersistence().findAll(begin, end);
137     }
138 
139     public static java.util.List findAll(int begin, int end,
140         com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.SystemException {
142         return getPersistence().findAll(begin, end, obc);
143     }
144 
145     public static void removeByActive(boolean active)
146         throws com.liferay.portal.SystemException {
147         getPersistence().removeByActive(active);
148     }
149 
150     public static void removeAll() throws com.liferay.portal.SystemException {
151         getPersistence().removeAll();
152     }
153 
154     public static int countByActive(boolean active)
155         throws com.liferay.portal.SystemException {
156         return getPersistence().countByActive(active);
157     }
158 
159     public static int countAll() throws com.liferay.portal.SystemException {
160         return getPersistence().countAll();
161     }
162 
163     public static CountryPersistence getPersistence() {
164         return _getUtil()._persistence;
165     }
166 
167     public void setPersistence(CountryPersistence persistence) {
168         _persistence = persistence;
169     }
170 
171     private static CountryUtil _getUtil() {
172         if (_util == null) {
173             _util = (CountryUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
174         }
175 
176         return _util;
177     }
178 
179     private static final String _UTIL = CountryUtil.class.getName();
180     private static CountryUtil _util;
181     private CountryPersistence _persistence;
182 }