1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19  import com.liferay.portal.kernel.exception.SystemException;
20  import com.liferay.portal.model.ResourceCode;
21  
22  import java.util.List;
23  
24  /**
25   * <a href="ResourceCodeUtil.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * @author    Brian Wing Shun Chan
33   * @see       ResourceCodePersistence
34   * @see       ResourceCodePersistenceImpl
35   * @generated
36   */
37  public class ResourceCodeUtil {
38      /**
39       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
40       */
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      /**
46       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(ResourceCode)
47       */
48      public static void clearCache(ResourceCode resourceCode) {
49          getPersistence().clearCache(resourceCode);
50      }
51  
52      /**
53       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
54       */
55      public long countWithDynamicQuery(DynamicQuery dynamicQuery)
56          throws SystemException {
57          return getPersistence().countWithDynamicQuery(dynamicQuery);
58      }
59  
60      /**
61       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
62       */
63      public static List<ResourceCode> findWithDynamicQuery(
64          DynamicQuery dynamicQuery) throws SystemException {
65          return getPersistence().findWithDynamicQuery(dynamicQuery);
66      }
67  
68      /**
69       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
70       */
71      public static List<ResourceCode> findWithDynamicQuery(
72          DynamicQuery dynamicQuery, int start, int end)
73          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.kernel.exception.SystemException {
110         return getPersistence().remove(codeId);
111     }
112 
113     public static com.liferay.portal.model.ResourceCode updateImpl(
114         com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
115         throws com.liferay.portal.kernel.exception.SystemException {
116         return getPersistence().updateImpl(resourceCode, merge);
117     }
118 
119     public static com.liferay.portal.model.ResourceCode findByPrimaryKey(
120         long codeId)
121         throws com.liferay.portal.NoSuchResourceCodeException,
122             com.liferay.portal.kernel.exception.SystemException {
123         return getPersistence().findByPrimaryKey(codeId);
124     }
125 
126     public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey(
127         long codeId) throws com.liferay.portal.kernel.exception.SystemException {
128         return getPersistence().fetchByPrimaryKey(codeId);
129     }
130 
131     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
132         long companyId)
133         throws com.liferay.portal.kernel.exception.SystemException {
134         return getPersistence().findByCompanyId(companyId);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
138         long companyId, int start, int end)
139         throws com.liferay.portal.kernel.exception.SystemException {
140         return getPersistence().findByCompanyId(companyId, start, end);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
144         long companyId, int start, int end,
145         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
146         throws com.liferay.portal.kernel.exception.SystemException {
147         return getPersistence()
148                    .findByCompanyId(companyId, start, end, orderByComparator);
149     }
150 
151     public static com.liferay.portal.model.ResourceCode findByCompanyId_First(
152         long companyId,
153         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
154         throws com.liferay.portal.NoSuchResourceCodeException,
155             com.liferay.portal.kernel.exception.SystemException {
156         return getPersistence()
157                    .findByCompanyId_First(companyId, orderByComparator);
158     }
159 
160     public static com.liferay.portal.model.ResourceCode findByCompanyId_Last(
161         long companyId,
162         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
163         throws com.liferay.portal.NoSuchResourceCodeException,
164             com.liferay.portal.kernel.exception.SystemException {
165         return getPersistence()
166                    .findByCompanyId_Last(companyId, orderByComparator);
167     }
168 
169     public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
170         long codeId, long companyId,
171         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
172         throws com.liferay.portal.NoSuchResourceCodeException,
173             com.liferay.portal.kernel.exception.SystemException {
174         return getPersistence()
175                    .findByCompanyId_PrevAndNext(codeId, companyId,
176             orderByComparator);
177     }
178 
179     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
180         java.lang.String name)
181         throws com.liferay.portal.kernel.exception.SystemException {
182         return getPersistence().findByName(name);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
186         java.lang.String name, int start, int end)
187         throws com.liferay.portal.kernel.exception.SystemException {
188         return getPersistence().findByName(name, start, end);
189     }
190 
191     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
192         java.lang.String name, int start, int end,
193         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
194         throws com.liferay.portal.kernel.exception.SystemException {
195         return getPersistence().findByName(name, start, end, orderByComparator);
196     }
197 
198     public static com.liferay.portal.model.ResourceCode findByName_First(
199         java.lang.String name,
200         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
201         throws com.liferay.portal.NoSuchResourceCodeException,
202             com.liferay.portal.kernel.exception.SystemException {
203         return getPersistence().findByName_First(name, orderByComparator);
204     }
205 
206     public static com.liferay.portal.model.ResourceCode findByName_Last(
207         java.lang.String name,
208         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
209         throws com.liferay.portal.NoSuchResourceCodeException,
210             com.liferay.portal.kernel.exception.SystemException {
211         return getPersistence().findByName_Last(name, orderByComparator);
212     }
213 
214     public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
215         long codeId, java.lang.String name,
216         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
217         throws com.liferay.portal.NoSuchResourceCodeException,
218             com.liferay.portal.kernel.exception.SystemException {
219         return getPersistence()
220                    .findByName_PrevAndNext(codeId, name, orderByComparator);
221     }
222 
223     public static com.liferay.portal.model.ResourceCode findByC_N_S(
224         long companyId, java.lang.String name, int scope)
225         throws com.liferay.portal.NoSuchResourceCodeException,
226             com.liferay.portal.kernel.exception.SystemException {
227         return getPersistence().findByC_N_S(companyId, name, scope);
228     }
229 
230     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
231         long companyId, java.lang.String name, int scope)
232         throws com.liferay.portal.kernel.exception.SystemException {
233         return getPersistence().fetchByC_N_S(companyId, name, scope);
234     }
235 
236     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
237         long companyId, java.lang.String name, int scope,
238         boolean retrieveFromCache)
239         throws com.liferay.portal.kernel.exception.SystemException {
240         return getPersistence()
241                    .fetchByC_N_S(companyId, name, scope, retrieveFromCache);
242     }
243 
244     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll()
245         throws com.liferay.portal.kernel.exception.SystemException {
246         return getPersistence().findAll();
247     }
248 
249     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
250         int start, int end)
251         throws com.liferay.portal.kernel.exception.SystemException {
252         return getPersistence().findAll(start, end);
253     }
254 
255     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
256         int start, int end,
257         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
258         throws com.liferay.portal.kernel.exception.SystemException {
259         return getPersistence().findAll(start, end, orderByComparator);
260     }
261 
262     public static void removeByCompanyId(long companyId)
263         throws com.liferay.portal.kernel.exception.SystemException {
264         getPersistence().removeByCompanyId(companyId);
265     }
266 
267     public static void removeByName(java.lang.String name)
268         throws com.liferay.portal.kernel.exception.SystemException {
269         getPersistence().removeByName(name);
270     }
271 
272     public static void removeByC_N_S(long companyId, java.lang.String name,
273         int scope)
274         throws com.liferay.portal.NoSuchResourceCodeException,
275             com.liferay.portal.kernel.exception.SystemException {
276         getPersistence().removeByC_N_S(companyId, name, scope);
277     }
278 
279     public static void removeAll()
280         throws com.liferay.portal.kernel.exception.SystemException {
281         getPersistence().removeAll();
282     }
283 
284     public static int countByCompanyId(long companyId)
285         throws com.liferay.portal.kernel.exception.SystemException {
286         return getPersistence().countByCompanyId(companyId);
287     }
288 
289     public static int countByName(java.lang.String name)
290         throws com.liferay.portal.kernel.exception.SystemException {
291         return getPersistence().countByName(name);
292     }
293 
294     public static int countByC_N_S(long companyId, java.lang.String name,
295         int scope) throws com.liferay.portal.kernel.exception.SystemException {
296         return getPersistence().countByC_N_S(companyId, name, scope);
297     }
298 
299     public static int countAll()
300         throws com.liferay.portal.kernel.exception.SystemException {
301         return getPersistence().countAll();
302     }
303 
304     public static ResourceCodePersistence getPersistence() {
305         if (_persistence == null) {
306             _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName());
307         }
308 
309         return _persistence;
310     }
311 
312     public void setPersistence(ResourceCodePersistence persistence) {
313         _persistence = persistence;
314     }
315 
316     private static ResourceCodePersistence _persistence;
317 }