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