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