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.ResourcePermission;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="ResourcePermissionUtil.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       ResourcePermissionPersistence
35   * @see       ResourcePermissionPersistenceImpl
36   * @generated
37   */
38  public class ResourcePermissionUtil {
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(ResourcePermission)
48       */
49      public static void clearCache(ResourcePermission resourcePermission) {
50          getPersistence().clearCache(resourcePermission);
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 ResourcePermission remove(
81          ResourcePermission resourcePermission) throws SystemException {
82          return getPersistence().remove(resourcePermission);
83      }
84  
85      /**
86       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
87       */
88      public static ResourcePermission update(
89          ResourcePermission resourcePermission, boolean merge)
90          throws SystemException {
91          return getPersistence().update(resourcePermission, merge);
92      }
93  
94      public static void cacheResult(
95          com.liferay.portal.model.ResourcePermission resourcePermission) {
96          getPersistence().cacheResult(resourcePermission);
97      }
98  
99      public static void cacheResult(
100         java.util.List<com.liferay.portal.model.ResourcePermission> resourcePermissions) {
101         getPersistence().cacheResult(resourcePermissions);
102     }
103 
104     public static com.liferay.portal.model.ResourcePermission create(
105         long resourcePermissionId) {
106         return getPersistence().create(resourcePermissionId);
107     }
108 
109     public static com.liferay.portal.model.ResourcePermission remove(
110         long resourcePermissionId)
111         throws com.liferay.portal.NoSuchResourcePermissionException,
112             com.liferay.portal.SystemException {
113         return getPersistence().remove(resourcePermissionId);
114     }
115 
116     /**
117      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
118      */
119     public static com.liferay.portal.model.ResourcePermission update(
120         com.liferay.portal.model.ResourcePermission resourcePermission)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().update(resourcePermission);
123     }
124 
125     public static com.liferay.portal.model.ResourcePermission updateImpl(
126         com.liferay.portal.model.ResourcePermission resourcePermission,
127         boolean merge) throws com.liferay.portal.SystemException {
128         return getPersistence().updateImpl(resourcePermission, merge);
129     }
130 
131     public static com.liferay.portal.model.ResourcePermission findByPrimaryKey(
132         long resourcePermissionId)
133         throws com.liferay.portal.NoSuchResourcePermissionException,
134             com.liferay.portal.SystemException {
135         return getPersistence().findByPrimaryKey(resourcePermissionId);
136     }
137 
138     public static com.liferay.portal.model.ResourcePermission fetchByPrimaryKey(
139         long resourcePermissionId) throws com.liferay.portal.SystemException {
140         return getPersistence().fetchByPrimaryKey(resourcePermissionId);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
144         long roleId) throws com.liferay.portal.SystemException {
145         return getPersistence().findByRoleId(roleId);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
149         long roleId, int start, int end)
150         throws com.liferay.portal.SystemException {
151         return getPersistence().findByRoleId(roleId, start, end);
152     }
153 
154     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
155         long roleId, int start, int end,
156         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
157         throws com.liferay.portal.SystemException {
158         return getPersistence()
159                    .findByRoleId(roleId, start, end, orderByComparator);
160     }
161 
162     public static com.liferay.portal.model.ResourcePermission findByRoleId_First(
163         long roleId,
164         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165         throws com.liferay.portal.NoSuchResourcePermissionException,
166             com.liferay.portal.SystemException {
167         return getPersistence().findByRoleId_First(roleId, orderByComparator);
168     }
169 
170     public static com.liferay.portal.model.ResourcePermission findByRoleId_Last(
171         long roleId,
172         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
173         throws com.liferay.portal.NoSuchResourcePermissionException,
174             com.liferay.portal.SystemException {
175         return getPersistence().findByRoleId_Last(roleId, orderByComparator);
176     }
177 
178     public static com.liferay.portal.model.ResourcePermission[] findByRoleId_PrevAndNext(
179         long resourcePermissionId, long roleId,
180         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
181         throws com.liferay.portal.NoSuchResourcePermissionException,
182             com.liferay.portal.SystemException {
183         return getPersistence()
184                    .findByRoleId_PrevAndNext(resourcePermissionId, roleId,
185             orderByComparator);
186     }
187 
188     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
189         long roleId, int scope) throws com.liferay.portal.SystemException {
190         return getPersistence().findByR_S(roleId, scope);
191     }
192 
193     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
194         long roleId, int scope, int start, int end)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().findByR_S(roleId, scope, start, end);
197     }
198 
199     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
200         long roleId, int scope, int start, int end,
201         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
202         throws com.liferay.portal.SystemException {
203         return getPersistence()
204                    .findByR_S(roleId, scope, start, end, orderByComparator);
205     }
206 
207     public static com.liferay.portal.model.ResourcePermission findByR_S_First(
208         long roleId, int scope,
209         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
210         throws com.liferay.portal.NoSuchResourcePermissionException,
211             com.liferay.portal.SystemException {
212         return getPersistence().findByR_S_First(roleId, scope, orderByComparator);
213     }
214 
215     public static com.liferay.portal.model.ResourcePermission findByR_S_Last(
216         long roleId, int scope,
217         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
218         throws com.liferay.portal.NoSuchResourcePermissionException,
219             com.liferay.portal.SystemException {
220         return getPersistence().findByR_S_Last(roleId, scope, orderByComparator);
221     }
222 
223     public static com.liferay.portal.model.ResourcePermission[] findByR_S_PrevAndNext(
224         long resourcePermissionId, long roleId, int scope,
225         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
226         throws com.liferay.portal.NoSuchResourcePermissionException,
227             com.liferay.portal.SystemException {
228         return getPersistence()
229                    .findByR_S_PrevAndNext(resourcePermissionId, roleId, scope,
230             orderByComparator);
231     }
232 
233     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
234         long companyId, java.lang.String name, int scope)
235         throws com.liferay.portal.SystemException {
236         return getPersistence().findByC_N_S(companyId, name, scope);
237     }
238 
239     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
240         long companyId, java.lang.String name, int scope, int start, int end)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().findByC_N_S(companyId, name, scope, start, end);
243     }
244 
245     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
246         long companyId, java.lang.String name, int scope, int start, int end,
247         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248         throws com.liferay.portal.SystemException {
249         return getPersistence()
250                    .findByC_N_S(companyId, name, scope, start, end,
251             orderByComparator);
252     }
253 
254     public static com.liferay.portal.model.ResourcePermission findByC_N_S_First(
255         long companyId, java.lang.String name, int scope,
256         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
257         throws com.liferay.portal.NoSuchResourcePermissionException,
258             com.liferay.portal.SystemException {
259         return getPersistence()
260                    .findByC_N_S_First(companyId, name, scope, orderByComparator);
261     }
262 
263     public static com.liferay.portal.model.ResourcePermission findByC_N_S_Last(
264         long companyId, java.lang.String name, int scope,
265         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266         throws com.liferay.portal.NoSuchResourcePermissionException,
267             com.liferay.portal.SystemException {
268         return getPersistence()
269                    .findByC_N_S_Last(companyId, name, scope, orderByComparator);
270     }
271 
272     public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_PrevAndNext(
273         long resourcePermissionId, long companyId, java.lang.String name,
274         int scope,
275         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
276         throws com.liferay.portal.NoSuchResourcePermissionException,
277             com.liferay.portal.SystemException {
278         return getPersistence()
279                    .findByC_N_S_PrevAndNext(resourcePermissionId, companyId,
280             name, scope, orderByComparator);
281     }
282 
283     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
284         long companyId, java.lang.String name, int scope,
285         java.lang.String primKey) throws com.liferay.portal.SystemException {
286         return getPersistence().findByC_N_S_P(companyId, name, scope, primKey);
287     }
288 
289     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
290         long companyId, java.lang.String name, int scope,
291         java.lang.String primKey, int start, int end)
292         throws com.liferay.portal.SystemException {
293         return getPersistence()
294                    .findByC_N_S_P(companyId, name, scope, primKey, start, end);
295     }
296 
297     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
298         long companyId, java.lang.String name, int scope,
299         java.lang.String primKey, int start, int end,
300         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
301         throws com.liferay.portal.SystemException {
302         return getPersistence()
303                    .findByC_N_S_P(companyId, name, scope, primKey, start, end,
304             orderByComparator);
305     }
306 
307     public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_First(
308         long companyId, java.lang.String name, int scope,
309         java.lang.String primKey,
310         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
311         throws com.liferay.portal.NoSuchResourcePermissionException,
312             com.liferay.portal.SystemException {
313         return getPersistence()
314                    .findByC_N_S_P_First(companyId, name, scope, primKey,
315             orderByComparator);
316     }
317 
318     public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_Last(
319         long companyId, java.lang.String name, int scope,
320         java.lang.String primKey,
321         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
322         throws com.liferay.portal.NoSuchResourcePermissionException,
323             com.liferay.portal.SystemException {
324         return getPersistence()
325                    .findByC_N_S_P_Last(companyId, name, scope, primKey,
326             orderByComparator);
327     }
328 
329     public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_P_PrevAndNext(
330         long resourcePermissionId, long companyId, java.lang.String name,
331         int scope, java.lang.String primKey,
332         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
333         throws com.liferay.portal.NoSuchResourcePermissionException,
334             com.liferay.portal.SystemException {
335         return getPersistence()
336                    .findByC_N_S_P_PrevAndNext(resourcePermissionId, companyId,
337             name, scope, primKey, orderByComparator);
338     }
339 
340     public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_R(
341         long companyId, java.lang.String name, int scope,
342         java.lang.String primKey, long roleId)
343         throws com.liferay.portal.NoSuchResourcePermissionException,
344             com.liferay.portal.SystemException {
345         return getPersistence()
346                    .findByC_N_S_P_R(companyId, name, scope, primKey, roleId);
347     }
348 
349     public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
350         long companyId, java.lang.String name, int scope,
351         java.lang.String primKey, long roleId)
352         throws com.liferay.portal.SystemException {
353         return getPersistence()
354                    .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId);
355     }
356 
357     public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
358         long companyId, java.lang.String name, int scope,
359         java.lang.String primKey, long roleId, boolean retrieveFromCache)
360         throws com.liferay.portal.SystemException {
361         return getPersistence()
362                    .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId,
363             retrieveFromCache);
364     }
365 
366     public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll()
367         throws com.liferay.portal.SystemException {
368         return getPersistence().findAll();
369     }
370 
371     public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
372         int start, int end) throws com.liferay.portal.SystemException {
373         return getPersistence().findAll(start, end);
374     }
375 
376     public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
377         int start, int end,
378         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
379         throws com.liferay.portal.SystemException {
380         return getPersistence().findAll(start, end, orderByComparator);
381     }
382 
383     public static void removeByRoleId(long roleId)
384         throws com.liferay.portal.SystemException {
385         getPersistence().removeByRoleId(roleId);
386     }
387 
388     public static void removeByR_S(long roleId, int scope)
389         throws com.liferay.portal.SystemException {
390         getPersistence().removeByR_S(roleId, scope);
391     }
392 
393     public static void removeByC_N_S(long companyId, java.lang.String name,
394         int scope) throws com.liferay.portal.SystemException {
395         getPersistence().removeByC_N_S(companyId, name, scope);
396     }
397 
398     public static void removeByC_N_S_P(long companyId, java.lang.String name,
399         int scope, java.lang.String primKey)
400         throws com.liferay.portal.SystemException {
401         getPersistence().removeByC_N_S_P(companyId, name, scope, primKey);
402     }
403 
404     public static void removeByC_N_S_P_R(long companyId, java.lang.String name,
405         int scope, java.lang.String primKey, long roleId)
406         throws com.liferay.portal.NoSuchResourcePermissionException,
407             com.liferay.portal.SystemException {
408         getPersistence()
409             .removeByC_N_S_P_R(companyId, name, scope, primKey, roleId);
410     }
411 
412     public static void removeAll() throws com.liferay.portal.SystemException {
413         getPersistence().removeAll();
414     }
415 
416     public static int countByRoleId(long roleId)
417         throws com.liferay.portal.SystemException {
418         return getPersistence().countByRoleId(roleId);
419     }
420 
421     public static int countByR_S(long roleId, int scope)
422         throws com.liferay.portal.SystemException {
423         return getPersistence().countByR_S(roleId, scope);
424     }
425 
426     public static int countByC_N_S(long companyId, java.lang.String name,
427         int scope) throws com.liferay.portal.SystemException {
428         return getPersistence().countByC_N_S(companyId, name, scope);
429     }
430 
431     public static int countByC_N_S_P(long companyId, java.lang.String name,
432         int scope, java.lang.String primKey)
433         throws com.liferay.portal.SystemException {
434         return getPersistence().countByC_N_S_P(companyId, name, scope, primKey);
435     }
436 
437     public static int countByC_N_S_P_R(long companyId, java.lang.String name,
438         int scope, java.lang.String primKey, long roleId)
439         throws com.liferay.portal.SystemException {
440         return getPersistence()
441                    .countByC_N_S_P_R(companyId, name, scope, primKey, roleId);
442     }
443 
444     public static int countAll() throws com.liferay.portal.SystemException {
445         return getPersistence().countAll();
446     }
447 
448     public static ResourcePermissionPersistence getPersistence() {
449         if (_persistence == null) {
450             _persistence = (ResourcePermissionPersistence)PortalBeanLocatorUtil.locate(ResourcePermissionPersistence.class.getName());
451 
452             ReferenceRegistry.registerReference(ResourcePermissionUtil.class,
453                 "_persistence");
454         }
455 
456         return _persistence;
457     }
458 
459     public void setPersistence(ResourcePermissionPersistence persistence) {
460         _persistence = persistence;
461 
462         ReferenceRegistry.registerReference(ResourcePermissionUtil.class,
463             "_persistence");
464     }
465 
466     private static ResourcePermissionPersistence _persistence;
467 }