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      /**
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.SystemException,
85              com.liferay.portal.NoSuchCountryException {
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 java.util.List<com.liferay.portal.model.Country> findByActive(
95          boolean active) throws com.liferay.portal.SystemException {
96          return getPersistence().findByActive(active);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.Country> findByActive(
100         boolean active, int begin, int end)
101         throws com.liferay.portal.SystemException {
102         return getPersistence().findByActive(active, begin, end);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.Country> findByActive(
106         boolean active, int begin, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findByActive(active, begin, end, obc);
110     }
111 
112     public static com.liferay.portal.model.Country findByActive_First(
113         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
114         throws com.liferay.portal.SystemException,
115             com.liferay.portal.NoSuchCountryException {
116         return getPersistence().findByActive_First(active, obc);
117     }
118 
119     public static com.liferay.portal.model.Country findByActive_Last(
120         boolean active, com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException,
122             com.liferay.portal.NoSuchCountryException {
123         return getPersistence().findByActive_Last(active, obc);
124     }
125 
126     public static com.liferay.portal.model.Country[] findByActive_PrevAndNext(
127         long countryId, boolean active,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException,
130             com.liferay.portal.NoSuchCountryException {
131         return getPersistence().findByActive_PrevAndNext(countryId, active, obc);
132     }
133 
134     public static java.util.List<com.liferay.portal.model.Country> findWithDynamicQuery(
135         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
136         throws com.liferay.portal.SystemException {
137         return getPersistence().findWithDynamicQuery(queryInitializer);
138     }
139 
140     public static java.util.List<com.liferay.portal.model.Country> findWithDynamicQuery(
141         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
142         int begin, int end) throws com.liferay.portal.SystemException {
143         return getPersistence()
144                    .findWithDynamicQuery(queryInitializer, begin, end);
145     }
146 
147     public static java.util.List<com.liferay.portal.model.Country> findAll()
148         throws com.liferay.portal.SystemException {
149         return getPersistence().findAll();
150     }
151 
152     public static java.util.List<com.liferay.portal.model.Country> findAll(
153         int begin, int end) throws com.liferay.portal.SystemException {
154         return getPersistence().findAll(begin, end);
155     }
156 
157     public static java.util.List<com.liferay.portal.model.Country> findAll(
158         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.SystemException {
160         return getPersistence().findAll(begin, end, obc);
161     }
162 
163     public static void removeByActive(boolean active)
164         throws com.liferay.portal.SystemException {
165         getPersistence().removeByActive(active);
166     }
167 
168     public static void removeAll() throws com.liferay.portal.SystemException {
169         getPersistence().removeAll();
170     }
171 
172     public static int countByActive(boolean active)
173         throws com.liferay.portal.SystemException {
174         return getPersistence().countByActive(active);
175     }
176 
177     public static int countAll() throws com.liferay.portal.SystemException {
178         return getPersistence().countAll();
179     }
180 
181     public static CountryPersistence getPersistence() {
182         return _getUtil()._persistence;
183     }
184 
185     public void setPersistence(CountryPersistence persistence) {
186         _persistence = persistence;
187     }
188 
189     private static CountryUtil _getUtil() {
190         if (_util == null) {
191             _util = (CountryUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
192         }
193 
194         return _util;
195     }
196 
197     private static final String _UTIL = CountryUtil.class.getName();
198     private static CountryUtil _util;
199     private CountryPersistence _persistence;
200 }