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