1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.ResourceCode;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="ResourceCodeUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       ResourceCodePersistence
35   * @see       ResourceCodePersistenceImpl
36   * @generated
37   */
38  public class ResourceCodeUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(ResourceCode)
48       */
49      public static void clearCache(ResourceCode resourceCode) {
50          getPersistence().clearCache(resourceCode);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static ResourceCode remove(ResourceCode resourceCode)
81          throws SystemException {
82          return getPersistence().remove(resourceCode);
83      }
84  
85      /**
86       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
87       */
88      public static ResourceCode update(ResourceCode resourceCode, boolean merge)
89          throws SystemException {
90          return getPersistence().update(resourceCode, merge);
91      }
92  
93      public static void cacheResult(
94          com.liferay.portal.model.ResourceCode resourceCode) {
95          getPersistence().cacheResult(resourceCode);
96      }
97  
98      public static void cacheResult(
99          java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) {
100         getPersistence().cacheResult(resourceCodes);
101     }
102 
103     public static com.liferay.portal.model.ResourceCode create(long codeId) {
104         return getPersistence().create(codeId);
105     }
106 
107     public static com.liferay.portal.model.ResourceCode remove(long codeId)
108         throws com.liferay.portal.NoSuchResourceCodeException,
109             com.liferay.portal.SystemException {
110         return getPersistence().remove(codeId);
111     }
112 
113     /**
114      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
115      */
116     public static com.liferay.portal.model.ResourceCode update(
117         com.liferay.portal.model.ResourceCode resourceCode)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().update(resourceCode);
120     }
121 
122     public static com.liferay.portal.model.ResourceCode updateImpl(
123         com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().updateImpl(resourceCode, merge);
126     }
127 
128     public static com.liferay.portal.model.ResourceCode findByPrimaryKey(
129         long codeId)
130         throws com.liferay.portal.NoSuchResourceCodeException,
131             com.liferay.portal.SystemException {
132         return getPersistence().findByPrimaryKey(codeId);
133     }
134 
135     public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey(
136         long codeId) throws com.liferay.portal.SystemException {
137         return getPersistence().fetchByPrimaryKey(codeId);
138     }
139 
140     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
141         long companyId) throws com.liferay.portal.SystemException {
142         return getPersistence().findByCompanyId(companyId);
143     }
144 
145     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
146         long companyId, int start, int end)
147         throws com.liferay.portal.SystemException {
148         return getPersistence().findByCompanyId(companyId, start, end);
149     }
150 
151     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
152         long companyId, int start, int end,
153         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
154         throws com.liferay.portal.SystemException {
155         return getPersistence()
156                    .findByCompanyId(companyId, start, end, orderByComparator);
157     }
158 
159     public static com.liferay.portal.model.ResourceCode findByCompanyId_First(
160         long companyId,
161         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162         throws com.liferay.portal.NoSuchResourceCodeException,
163             com.liferay.portal.SystemException {
164         return getPersistence()
165                    .findByCompanyId_First(companyId, orderByComparator);
166     }
167 
168     public static com.liferay.portal.model.ResourceCode findByCompanyId_Last(
169         long companyId,
170         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
171         throws com.liferay.portal.NoSuchResourceCodeException,
172             com.liferay.portal.SystemException {
173         return getPersistence()
174                    .findByCompanyId_Last(companyId, orderByComparator);
175     }
176 
177     public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
178         long codeId, long companyId,
179         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
180         throws com.liferay.portal.NoSuchResourceCodeException,
181             com.liferay.portal.SystemException {
182         return getPersistence()
183                    .findByCompanyId_PrevAndNext(codeId, companyId,
184             orderByComparator);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
188         java.lang.String name) throws com.liferay.portal.SystemException {
189         return getPersistence().findByName(name);
190     }
191 
192     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
193         java.lang.String name, int start, int end)
194         throws com.liferay.portal.SystemException {
195         return getPersistence().findByName(name, start, end);
196     }
197 
198     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
199         java.lang.String name, int start, int end,
200         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
201         throws com.liferay.portal.SystemException {
202         return getPersistence().findByName(name, start, end, orderByComparator);
203     }
204 
205     public static com.liferay.portal.model.ResourceCode findByName_First(
206         java.lang.String name,
207         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
208         throws com.liferay.portal.NoSuchResourceCodeException,
209             com.liferay.portal.SystemException {
210         return getPersistence().findByName_First(name, orderByComparator);
211     }
212 
213     public static com.liferay.portal.model.ResourceCode findByName_Last(
214         java.lang.String name,
215         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
216         throws com.liferay.portal.NoSuchResourceCodeException,
217             com.liferay.portal.SystemException {
218         return getPersistence().findByName_Last(name, orderByComparator);
219     }
220 
221     public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
222         long codeId, java.lang.String name,
223         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
224         throws com.liferay.portal.NoSuchResourceCodeException,
225             com.liferay.portal.SystemException {
226         return getPersistence()
227                    .findByName_PrevAndNext(codeId, name, orderByComparator);
228     }
229 
230     public static com.liferay.portal.model.ResourceCode findByC_N_S(
231         long companyId, java.lang.String name, int scope)
232         throws com.liferay.portal.NoSuchResourceCodeException,
233             com.liferay.portal.SystemException {
234         return getPersistence().findByC_N_S(companyId, name, scope);
235     }
236 
237     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
238         long companyId, java.lang.String name, int scope)
239         throws com.liferay.portal.SystemException {
240         return getPersistence().fetchByC_N_S(companyId, name, scope);
241     }
242 
243     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
244         long companyId, java.lang.String name, int scope,
245         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
246         return getPersistence()
247                    .fetchByC_N_S(companyId, name, scope, retrieveFromCache);
248     }
249 
250     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll()
251         throws com.liferay.portal.SystemException {
252         return getPersistence().findAll();
253     }
254 
255     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
256         int start, int end) throws com.liferay.portal.SystemException {
257         return getPersistence().findAll(start, end);
258     }
259 
260     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
261         int start, int end,
262         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
263         throws com.liferay.portal.SystemException {
264         return getPersistence().findAll(start, end, orderByComparator);
265     }
266 
267     public static void removeByCompanyId(long companyId)
268         throws com.liferay.portal.SystemException {
269         getPersistence().removeByCompanyId(companyId);
270     }
271 
272     public static void removeByName(java.lang.String name)
273         throws com.liferay.portal.SystemException {
274         getPersistence().removeByName(name);
275     }
276 
277     public static void removeByC_N_S(long companyId, java.lang.String name,
278         int scope)
279         throws com.liferay.portal.NoSuchResourceCodeException,
280             com.liferay.portal.SystemException {
281         getPersistence().removeByC_N_S(companyId, name, scope);
282     }
283 
284     public static void removeAll() throws com.liferay.portal.SystemException {
285         getPersistence().removeAll();
286     }
287 
288     public static int countByCompanyId(long companyId)
289         throws com.liferay.portal.SystemException {
290         return getPersistence().countByCompanyId(companyId);
291     }
292 
293     public static int countByName(java.lang.String name)
294         throws com.liferay.portal.SystemException {
295         return getPersistence().countByName(name);
296     }
297 
298     public static int countByC_N_S(long companyId, java.lang.String name,
299         int scope) throws com.liferay.portal.SystemException {
300         return getPersistence().countByC_N_S(companyId, name, scope);
301     }
302 
303     public static int countAll() throws com.liferay.portal.SystemException {
304         return getPersistence().countAll();
305     }
306 
307     public static ResourceCodePersistence getPersistence() {
308         if (_persistence == null) {
309             _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName());
310 
311             ReferenceRegistry.registerReference(ResourceCodeUtil.class,
312                 "_persistence");
313         }
314 
315         return _persistence;
316     }
317 
318     public void setPersistence(ResourceCodePersistence persistence) {
319         _persistence = persistence;
320 
321         ReferenceRegistry.registerReference(ResourceCodeUtil.class,
322             "_persistence");
323     }
324 
325     private static ResourceCodePersistence _persistence;
326 }