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.Permission;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="PermissionUtil.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       PermissionPersistence
35   * @see       PermissionPersistenceImpl
36   * @generated
37   */
38  public class PermissionUtil {
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(Permission)
48       */
49      public static void clearCache(Permission permission) {
50          getPersistence().clearCache(permission);
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 Permission remove(Permission permission)
81          throws SystemException {
82          return getPersistence().remove(permission);
83      }
84  
85      /**
86       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
87       */
88      public static Permission update(Permission permission, boolean merge)
89          throws SystemException {
90          return getPersistence().update(permission, merge);
91      }
92  
93      public static void cacheResult(
94          com.liferay.portal.model.Permission permission) {
95          getPersistence().cacheResult(permission);
96      }
97  
98      public static void cacheResult(
99          java.util.List<com.liferay.portal.model.Permission> permissions) {
100         getPersistence().cacheResult(permissions);
101     }
102 
103     public static com.liferay.portal.model.Permission create(long permissionId) {
104         return getPersistence().create(permissionId);
105     }
106 
107     public static com.liferay.portal.model.Permission remove(long permissionId)
108         throws com.liferay.portal.NoSuchPermissionException,
109             com.liferay.portal.SystemException {
110         return getPersistence().remove(permissionId);
111     }
112 
113     /**
114      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
115      */
116     public static com.liferay.portal.model.Permission update(
117         com.liferay.portal.model.Permission permission)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().update(permission);
120     }
121 
122     public static com.liferay.portal.model.Permission updateImpl(
123         com.liferay.portal.model.Permission permission, boolean merge)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().updateImpl(permission, merge);
126     }
127 
128     public static com.liferay.portal.model.Permission findByPrimaryKey(
129         long permissionId)
130         throws com.liferay.portal.NoSuchPermissionException,
131             com.liferay.portal.SystemException {
132         return getPersistence().findByPrimaryKey(permissionId);
133     }
134 
135     public static com.liferay.portal.model.Permission fetchByPrimaryKey(
136         long permissionId) throws com.liferay.portal.SystemException {
137         return getPersistence().fetchByPrimaryKey(permissionId);
138     }
139 
140     public static java.util.List<com.liferay.portal.model.Permission> findByResourceId(
141         long resourceId) throws com.liferay.portal.SystemException {
142         return getPersistence().findByResourceId(resourceId);
143     }
144 
145     public static java.util.List<com.liferay.portal.model.Permission> findByResourceId(
146         long resourceId, int start, int end)
147         throws com.liferay.portal.SystemException {
148         return getPersistence().findByResourceId(resourceId, start, end);
149     }
150 
151     public static java.util.List<com.liferay.portal.model.Permission> findByResourceId(
152         long resourceId, int start, int end,
153         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
154         throws com.liferay.portal.SystemException {
155         return getPersistence()
156                    .findByResourceId(resourceId, start, end, orderByComparator);
157     }
158 
159     public static com.liferay.portal.model.Permission findByResourceId_First(
160         long resourceId,
161         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162         throws com.liferay.portal.NoSuchPermissionException,
163             com.liferay.portal.SystemException {
164         return getPersistence()
165                    .findByResourceId_First(resourceId, orderByComparator);
166     }
167 
168     public static com.liferay.portal.model.Permission findByResourceId_Last(
169         long resourceId,
170         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
171         throws com.liferay.portal.NoSuchPermissionException,
172             com.liferay.portal.SystemException {
173         return getPersistence()
174                    .findByResourceId_Last(resourceId, orderByComparator);
175     }
176 
177     public static com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
178         long permissionId, long resourceId,
179         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
180         throws com.liferay.portal.NoSuchPermissionException,
181             com.liferay.portal.SystemException {
182         return getPersistence()
183                    .findByResourceId_PrevAndNext(permissionId, resourceId,
184             orderByComparator);
185     }
186 
187     public static com.liferay.portal.model.Permission findByA_R(
188         java.lang.String actionId, long resourceId)
189         throws com.liferay.portal.NoSuchPermissionException,
190             com.liferay.portal.SystemException {
191         return getPersistence().findByA_R(actionId, resourceId);
192     }
193 
194     public static com.liferay.portal.model.Permission fetchByA_R(
195         java.lang.String actionId, long resourceId)
196         throws com.liferay.portal.SystemException {
197         return getPersistence().fetchByA_R(actionId, resourceId);
198     }
199 
200     public static com.liferay.portal.model.Permission fetchByA_R(
201         java.lang.String actionId, long resourceId, boolean retrieveFromCache)
202         throws com.liferay.portal.SystemException {
203         return getPersistence()
204                    .fetchByA_R(actionId, resourceId, retrieveFromCache);
205     }
206 
207     public static java.util.List<com.liferay.portal.model.Permission> findAll()
208         throws com.liferay.portal.SystemException {
209         return getPersistence().findAll();
210     }
211 
212     public static java.util.List<com.liferay.portal.model.Permission> findAll(
213         int start, int end) throws com.liferay.portal.SystemException {
214         return getPersistence().findAll(start, end);
215     }
216 
217     public static java.util.List<com.liferay.portal.model.Permission> findAll(
218         int start, int end,
219         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
220         throws com.liferay.portal.SystemException {
221         return getPersistence().findAll(start, end, orderByComparator);
222     }
223 
224     public static void removeByResourceId(long resourceId)
225         throws com.liferay.portal.SystemException {
226         getPersistence().removeByResourceId(resourceId);
227     }
228 
229     public static void removeByA_R(java.lang.String actionId, long resourceId)
230         throws com.liferay.portal.NoSuchPermissionException,
231             com.liferay.portal.SystemException {
232         getPersistence().removeByA_R(actionId, resourceId);
233     }
234 
235     public static void removeAll() throws com.liferay.portal.SystemException {
236         getPersistence().removeAll();
237     }
238 
239     public static int countByResourceId(long resourceId)
240         throws com.liferay.portal.SystemException {
241         return getPersistence().countByResourceId(resourceId);
242     }
243 
244     public static int countByA_R(java.lang.String actionId, long resourceId)
245         throws com.liferay.portal.SystemException {
246         return getPersistence().countByA_R(actionId, resourceId);
247     }
248 
249     public static int countAll() throws com.liferay.portal.SystemException {
250         return getPersistence().countAll();
251     }
252 
253     public static java.util.List<com.liferay.portal.model.Group> getGroups(
254         long pk) throws com.liferay.portal.SystemException {
255         return getPersistence().getGroups(pk);
256     }
257 
258     public static java.util.List<com.liferay.portal.model.Group> getGroups(
259         long pk, int start, int end) throws com.liferay.portal.SystemException {
260         return getPersistence().getGroups(pk, start, end);
261     }
262 
263     public static java.util.List<com.liferay.portal.model.Group> getGroups(
264         long pk, int start, int end,
265         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266         throws com.liferay.portal.SystemException {
267         return getPersistence().getGroups(pk, start, end, orderByComparator);
268     }
269 
270     public static int getGroupsSize(long pk)
271         throws com.liferay.portal.SystemException {
272         return getPersistence().getGroupsSize(pk);
273     }
274 
275     public static boolean containsGroup(long pk, long groupPK)
276         throws com.liferay.portal.SystemException {
277         return getPersistence().containsGroup(pk, groupPK);
278     }
279 
280     public static boolean containsGroups(long pk)
281         throws com.liferay.portal.SystemException {
282         return getPersistence().containsGroups(pk);
283     }
284 
285     public static void addGroup(long pk, long groupPK)
286         throws com.liferay.portal.SystemException {
287         getPersistence().addGroup(pk, groupPK);
288     }
289 
290     public static void addGroup(long pk, com.liferay.portal.model.Group group)
291         throws com.liferay.portal.SystemException {
292         getPersistence().addGroup(pk, group);
293     }
294 
295     public static void addGroups(long pk, long[] groupPKs)
296         throws com.liferay.portal.SystemException {
297         getPersistence().addGroups(pk, groupPKs);
298     }
299 
300     public static void addGroups(long pk,
301         java.util.List<com.liferay.portal.model.Group> groups)
302         throws com.liferay.portal.SystemException {
303         getPersistence().addGroups(pk, groups);
304     }
305 
306     public static void clearGroups(long pk)
307         throws com.liferay.portal.SystemException {
308         getPersistence().clearGroups(pk);
309     }
310 
311     public static void removeGroup(long pk, long groupPK)
312         throws com.liferay.portal.SystemException {
313         getPersistence().removeGroup(pk, groupPK);
314     }
315 
316     public static void removeGroup(long pk, com.liferay.portal.model.Group group)
317         throws com.liferay.portal.SystemException {
318         getPersistence().removeGroup(pk, group);
319     }
320 
321     public static void removeGroups(long pk, long[] groupPKs)
322         throws com.liferay.portal.SystemException {
323         getPersistence().removeGroups(pk, groupPKs);
324     }
325 
326     public static void removeGroups(long pk,
327         java.util.List<com.liferay.portal.model.Group> groups)
328         throws com.liferay.portal.SystemException {
329         getPersistence().removeGroups(pk, groups);
330     }
331 
332     public static void setGroups(long pk, long[] groupPKs)
333         throws com.liferay.portal.SystemException {
334         getPersistence().setGroups(pk, groupPKs);
335     }
336 
337     public static void setGroups(long pk,
338         java.util.List<com.liferay.portal.model.Group> groups)
339         throws com.liferay.portal.SystemException {
340         getPersistence().setGroups(pk, groups);
341     }
342 
343     public static java.util.List<com.liferay.portal.model.Role> getRoles(
344         long pk) throws com.liferay.portal.SystemException {
345         return getPersistence().getRoles(pk);
346     }
347 
348     public static java.util.List<com.liferay.portal.model.Role> getRoles(
349         long pk, int start, int end) throws com.liferay.portal.SystemException {
350         return getPersistence().getRoles(pk, start, end);
351     }
352 
353     public static java.util.List<com.liferay.portal.model.Role> getRoles(
354         long pk, int start, int end,
355         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
356         throws com.liferay.portal.SystemException {
357         return getPersistence().getRoles(pk, start, end, orderByComparator);
358     }
359 
360     public static int getRolesSize(long pk)
361         throws com.liferay.portal.SystemException {
362         return getPersistence().getRolesSize(pk);
363     }
364 
365     public static boolean containsRole(long pk, long rolePK)
366         throws com.liferay.portal.SystemException {
367         return getPersistence().containsRole(pk, rolePK);
368     }
369 
370     public static boolean containsRoles(long pk)
371         throws com.liferay.portal.SystemException {
372         return getPersistence().containsRoles(pk);
373     }
374 
375     public static void addRole(long pk, long rolePK)
376         throws com.liferay.portal.SystemException {
377         getPersistence().addRole(pk, rolePK);
378     }
379 
380     public static void addRole(long pk, com.liferay.portal.model.Role role)
381         throws com.liferay.portal.SystemException {
382         getPersistence().addRole(pk, role);
383     }
384 
385     public static void addRoles(long pk, long[] rolePKs)
386         throws com.liferay.portal.SystemException {
387         getPersistence().addRoles(pk, rolePKs);
388     }
389 
390     public static void addRoles(long pk,
391         java.util.List<com.liferay.portal.model.Role> roles)
392         throws com.liferay.portal.SystemException {
393         getPersistence().addRoles(pk, roles);
394     }
395 
396     public static void clearRoles(long pk)
397         throws com.liferay.portal.SystemException {
398         getPersistence().clearRoles(pk);
399     }
400 
401     public static void removeRole(long pk, long rolePK)
402         throws com.liferay.portal.SystemException {
403         getPersistence().removeRole(pk, rolePK);
404     }
405 
406     public static void removeRole(long pk, com.liferay.portal.model.Role role)
407         throws com.liferay.portal.SystemException {
408         getPersistence().removeRole(pk, role);
409     }
410 
411     public static void removeRoles(long pk, long[] rolePKs)
412         throws com.liferay.portal.SystemException {
413         getPersistence().removeRoles(pk, rolePKs);
414     }
415 
416     public static void removeRoles(long pk,
417         java.util.List<com.liferay.portal.model.Role> roles)
418         throws com.liferay.portal.SystemException {
419         getPersistence().removeRoles(pk, roles);
420     }
421 
422     public static void setRoles(long pk, long[] rolePKs)
423         throws com.liferay.portal.SystemException {
424         getPersistence().setRoles(pk, rolePKs);
425     }
426 
427     public static void setRoles(long pk,
428         java.util.List<com.liferay.portal.model.Role> roles)
429         throws com.liferay.portal.SystemException {
430         getPersistence().setRoles(pk, roles);
431     }
432 
433     public static java.util.List<com.liferay.portal.model.User> getUsers(
434         long pk) throws com.liferay.portal.SystemException {
435         return getPersistence().getUsers(pk);
436     }
437 
438     public static java.util.List<com.liferay.portal.model.User> getUsers(
439         long pk, int start, int end) throws com.liferay.portal.SystemException {
440         return getPersistence().getUsers(pk, start, end);
441     }
442 
443     public static java.util.List<com.liferay.portal.model.User> getUsers(
444         long pk, int start, int end,
445         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
446         throws com.liferay.portal.SystemException {
447         return getPersistence().getUsers(pk, start, end, orderByComparator);
448     }
449 
450     public static int getUsersSize(long pk)
451         throws com.liferay.portal.SystemException {
452         return getPersistence().getUsersSize(pk);
453     }
454 
455     public static boolean containsUser(long pk, long userPK)
456         throws com.liferay.portal.SystemException {
457         return getPersistence().containsUser(pk, userPK);
458     }
459 
460     public static boolean containsUsers(long pk)
461         throws com.liferay.portal.SystemException {
462         return getPersistence().containsUsers(pk);
463     }
464 
465     public static void addUser(long pk, long userPK)
466         throws com.liferay.portal.SystemException {
467         getPersistence().addUser(pk, userPK);
468     }
469 
470     public static void addUser(long pk, com.liferay.portal.model.User user)
471         throws com.liferay.portal.SystemException {
472         getPersistence().addUser(pk, user);
473     }
474 
475     public static void addUsers(long pk, long[] userPKs)
476         throws com.liferay.portal.SystemException {
477         getPersistence().addUsers(pk, userPKs);
478     }
479 
480     public static void addUsers(long pk,
481         java.util.List<com.liferay.portal.model.User> users)
482         throws com.liferay.portal.SystemException {
483         getPersistence().addUsers(pk, users);
484     }
485 
486     public static void clearUsers(long pk)
487         throws com.liferay.portal.SystemException {
488         getPersistence().clearUsers(pk);
489     }
490 
491     public static void removeUser(long pk, long userPK)
492         throws com.liferay.portal.SystemException {
493         getPersistence().removeUser(pk, userPK);
494     }
495 
496     public static void removeUser(long pk, com.liferay.portal.model.User user)
497         throws com.liferay.portal.SystemException {
498         getPersistence().removeUser(pk, user);
499     }
500 
501     public static void removeUsers(long pk, long[] userPKs)
502         throws com.liferay.portal.SystemException {
503         getPersistence().removeUsers(pk, userPKs);
504     }
505 
506     public static void removeUsers(long pk,
507         java.util.List<com.liferay.portal.model.User> users)
508         throws com.liferay.portal.SystemException {
509         getPersistence().removeUsers(pk, users);
510     }
511 
512     public static void setUsers(long pk, long[] userPKs)
513         throws com.liferay.portal.SystemException {
514         getPersistence().setUsers(pk, userPKs);
515     }
516 
517     public static void setUsers(long pk,
518         java.util.List<com.liferay.portal.model.User> users)
519         throws com.liferay.portal.SystemException {
520         getPersistence().setUsers(pk, users);
521     }
522 
523     public static PermissionPersistence getPersistence() {
524         if (_persistence == null) {
525             _persistence = (PermissionPersistence)PortalBeanLocatorUtil.locate(PermissionPersistence.class.getName());
526 
527             ReferenceRegistry.registerReference(PermissionUtil.class,
528                 "_persistence");
529         }
530 
531         return _persistence;
532     }
533 
534     public void setPersistence(PermissionPersistence persistence) {
535         _persistence = persistence;
536 
537         ReferenceRegistry.registerReference(PermissionUtil.class, "_persistence");
538     }
539 
540     private static PermissionPersistence _persistence;
541 }