001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.Permission;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the permission service. This utility wraps {@link PermissionPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see PermissionPersistence
036     * @see PermissionPersistenceImpl
037     * @generated
038     */
039    public class PermissionUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(Permission permission) {
057                    getPersistence().clearCache(permission);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<Permission> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<Permission> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<Permission> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
098             */
099            public static Permission update(Permission permission, boolean merge)
100                    throws SystemException {
101                    return getPersistence().update(permission, merge);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
106             */
107            public static Permission update(Permission permission, boolean merge,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(permission, merge, serviceContext);
110            }
111    
112            /**
113            * Caches the permission in the entity cache if it is enabled.
114            *
115            * @param permission the permission
116            */
117            public static void cacheResult(
118                    com.liferay.portal.model.Permission permission) {
119                    getPersistence().cacheResult(permission);
120            }
121    
122            /**
123            * Caches the permissions in the entity cache if it is enabled.
124            *
125            * @param permissions the permissions
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portal.model.Permission> permissions) {
129                    getPersistence().cacheResult(permissions);
130            }
131    
132            /**
133            * Creates a new permission with the primary key. Does not add the permission to the database.
134            *
135            * @param permissionId the primary key for the new permission
136            * @return the new permission
137            */
138            public static com.liferay.portal.model.Permission create(long permissionId) {
139                    return getPersistence().create(permissionId);
140            }
141    
142            /**
143            * Removes the permission with the primary key from the database. Also notifies the appropriate model listeners.
144            *
145            * @param permissionId the primary key of the permission
146            * @return the permission that was removed
147            * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found
148            * @throws SystemException if a system exception occurred
149            */
150            public static com.liferay.portal.model.Permission remove(long permissionId)
151                    throws com.liferay.portal.NoSuchPermissionException,
152                            com.liferay.portal.kernel.exception.SystemException {
153                    return getPersistence().remove(permissionId);
154            }
155    
156            public static com.liferay.portal.model.Permission updateImpl(
157                    com.liferay.portal.model.Permission permission, boolean merge)
158                    throws com.liferay.portal.kernel.exception.SystemException {
159                    return getPersistence().updateImpl(permission, merge);
160            }
161    
162            /**
163            * Returns the permission with the primary key or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found.
164            *
165            * @param permissionId the primary key of the permission
166            * @return the permission
167            * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found
168            * @throws SystemException if a system exception occurred
169            */
170            public static com.liferay.portal.model.Permission findByPrimaryKey(
171                    long permissionId)
172                    throws com.liferay.portal.NoSuchPermissionException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    return getPersistence().findByPrimaryKey(permissionId);
175            }
176    
177            /**
178            * Returns the permission with the primary key or returns <code>null</code> if it could not be found.
179            *
180            * @param permissionId the primary key of the permission
181            * @return the permission, or <code>null</code> if a permission with the primary key could not be found
182            * @throws SystemException if a system exception occurred
183            */
184            public static com.liferay.portal.model.Permission fetchByPrimaryKey(
185                    long permissionId)
186                    throws com.liferay.portal.kernel.exception.SystemException {
187                    return getPersistence().fetchByPrimaryKey(permissionId);
188            }
189    
190            /**
191            * Returns all the permissions where resourceId = &#63;.
192            *
193            * @param resourceId the resource ID
194            * @return the matching permissions
195            * @throws SystemException if a system exception occurred
196            */
197            public static java.util.List<com.liferay.portal.model.Permission> findByResourceId(
198                    long resourceId)
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getPersistence().findByResourceId(resourceId);
201            }
202    
203            /**
204            * Returns a range of all the permissions where resourceId = &#63;.
205            *
206            * <p>
207            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
208            * </p>
209            *
210            * @param resourceId the resource ID
211            * @param start the lower bound of the range of permissions
212            * @param end the upper bound of the range of permissions (not inclusive)
213            * @return the range of matching permissions
214            * @throws SystemException if a system exception occurred
215            */
216            public static java.util.List<com.liferay.portal.model.Permission> findByResourceId(
217                    long resourceId, int start, int end)
218                    throws com.liferay.portal.kernel.exception.SystemException {
219                    return getPersistence().findByResourceId(resourceId, start, end);
220            }
221    
222            /**
223            * Returns an ordered range of all the permissions where resourceId = &#63;.
224            *
225            * <p>
226            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
227            * </p>
228            *
229            * @param resourceId the resource ID
230            * @param start the lower bound of the range of permissions
231            * @param end the upper bound of the range of permissions (not inclusive)
232            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
233            * @return the ordered range of matching permissions
234            * @throws SystemException if a system exception occurred
235            */
236            public static java.util.List<com.liferay.portal.model.Permission> findByResourceId(
237                    long resourceId, int start, int end,
238                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
239                    throws com.liferay.portal.kernel.exception.SystemException {
240                    return getPersistence()
241                                       .findByResourceId(resourceId, start, end, orderByComparator);
242            }
243    
244            /**
245            * Returns the first permission in the ordered set where resourceId = &#63;.
246            *
247            * <p>
248            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
249            * </p>
250            *
251            * @param resourceId the resource ID
252            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
253            * @return the first matching permission
254            * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found
255            * @throws SystemException if a system exception occurred
256            */
257            public static com.liferay.portal.model.Permission findByResourceId_First(
258                    long resourceId,
259                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
260                    throws com.liferay.portal.NoSuchPermissionException,
261                            com.liferay.portal.kernel.exception.SystemException {
262                    return getPersistence()
263                                       .findByResourceId_First(resourceId, orderByComparator);
264            }
265    
266            /**
267            * Returns the last permission in the ordered set where resourceId = &#63;.
268            *
269            * <p>
270            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
271            * </p>
272            *
273            * @param resourceId the resource ID
274            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
275            * @return the last matching permission
276            * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public static com.liferay.portal.model.Permission findByResourceId_Last(
280                    long resourceId,
281                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
282                    throws com.liferay.portal.NoSuchPermissionException,
283                            com.liferay.portal.kernel.exception.SystemException {
284                    return getPersistence()
285                                       .findByResourceId_Last(resourceId, orderByComparator);
286            }
287    
288            /**
289            * Returns the permissions before and after the current permission in the ordered set where resourceId = &#63;.
290            *
291            * <p>
292            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
293            * </p>
294            *
295            * @param permissionId the primary key of the current permission
296            * @param resourceId the resource ID
297            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
298            * @return the previous, current, and next permission
299            * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found
300            * @throws SystemException if a system exception occurred
301            */
302            public static com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
303                    long permissionId, long resourceId,
304                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
305                    throws com.liferay.portal.NoSuchPermissionException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    return getPersistence()
308                                       .findByResourceId_PrevAndNext(permissionId, resourceId,
309                            orderByComparator);
310            }
311    
312            /**
313            * Returns the permission where actionId = &#63; and resourceId = &#63; or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found.
314            *
315            * @param actionId the action ID
316            * @param resourceId the resource ID
317            * @return the matching permission
318            * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found
319            * @throws SystemException if a system exception occurred
320            */
321            public static com.liferay.portal.model.Permission findByA_R(
322                    java.lang.String actionId, long resourceId)
323                    throws com.liferay.portal.NoSuchPermissionException,
324                            com.liferay.portal.kernel.exception.SystemException {
325                    return getPersistence().findByA_R(actionId, resourceId);
326            }
327    
328            /**
329            * Returns the permission where actionId = &#63; and resourceId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
330            *
331            * @param actionId the action ID
332            * @param resourceId the resource ID
333            * @return the matching permission, or <code>null</code> if a matching permission could not be found
334            * @throws SystemException if a system exception occurred
335            */
336            public static com.liferay.portal.model.Permission fetchByA_R(
337                    java.lang.String actionId, long resourceId)
338                    throws com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().fetchByA_R(actionId, resourceId);
340            }
341    
342            /**
343            * Returns the permission where actionId = &#63; and resourceId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
344            *
345            * @param actionId the action ID
346            * @param resourceId the resource ID
347            * @param retrieveFromCache whether to use the finder cache
348            * @return the matching permission, or <code>null</code> if a matching permission could not be found
349            * @throws SystemException if a system exception occurred
350            */
351            public static com.liferay.portal.model.Permission fetchByA_R(
352                    java.lang.String actionId, long resourceId, boolean retrieveFromCache)
353                    throws com.liferay.portal.kernel.exception.SystemException {
354                    return getPersistence()
355                                       .fetchByA_R(actionId, resourceId, retrieveFromCache);
356            }
357    
358            /**
359            * Returns all the permissions.
360            *
361            * @return the permissions
362            * @throws SystemException if a system exception occurred
363            */
364            public static java.util.List<com.liferay.portal.model.Permission> findAll()
365                    throws com.liferay.portal.kernel.exception.SystemException {
366                    return getPersistence().findAll();
367            }
368    
369            /**
370            * Returns a range of all the permissions.
371            *
372            * <p>
373            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
374            * </p>
375            *
376            * @param start the lower bound of the range of permissions
377            * @param end the upper bound of the range of permissions (not inclusive)
378            * @return the range of permissions
379            * @throws SystemException if a system exception occurred
380            */
381            public static java.util.List<com.liferay.portal.model.Permission> findAll(
382                    int start, int end)
383                    throws com.liferay.portal.kernel.exception.SystemException {
384                    return getPersistence().findAll(start, end);
385            }
386    
387            /**
388            * Returns an ordered range of all the permissions.
389            *
390            * <p>
391            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
392            * </p>
393            *
394            * @param start the lower bound of the range of permissions
395            * @param end the upper bound of the range of permissions (not inclusive)
396            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
397            * @return the ordered range of permissions
398            * @throws SystemException if a system exception occurred
399            */
400            public static java.util.List<com.liferay.portal.model.Permission> findAll(
401                    int start, int end,
402                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
403                    throws com.liferay.portal.kernel.exception.SystemException {
404                    return getPersistence().findAll(start, end, orderByComparator);
405            }
406    
407            /**
408            * Removes all the permissions where resourceId = &#63; from the database.
409            *
410            * @param resourceId the resource ID
411            * @throws SystemException if a system exception occurred
412            */
413            public static void removeByResourceId(long resourceId)
414                    throws com.liferay.portal.kernel.exception.SystemException {
415                    getPersistence().removeByResourceId(resourceId);
416            }
417    
418            /**
419            * Removes the permission where actionId = &#63; and resourceId = &#63; from the database.
420            *
421            * @param actionId the action ID
422            * @param resourceId the resource ID
423            * @throws SystemException if a system exception occurred
424            */
425            public static void removeByA_R(java.lang.String actionId, long resourceId)
426                    throws com.liferay.portal.NoSuchPermissionException,
427                            com.liferay.portal.kernel.exception.SystemException {
428                    getPersistence().removeByA_R(actionId, resourceId);
429            }
430    
431            /**
432            * Removes all the permissions from the database.
433            *
434            * @throws SystemException if a system exception occurred
435            */
436            public static void removeAll()
437                    throws com.liferay.portal.kernel.exception.SystemException {
438                    getPersistence().removeAll();
439            }
440    
441            /**
442            * Returns the number of permissions where resourceId = &#63;.
443            *
444            * @param resourceId the resource ID
445            * @return the number of matching permissions
446            * @throws SystemException if a system exception occurred
447            */
448            public static int countByResourceId(long resourceId)
449                    throws com.liferay.portal.kernel.exception.SystemException {
450                    return getPersistence().countByResourceId(resourceId);
451            }
452    
453            /**
454            * Returns the number of permissions where actionId = &#63; and resourceId = &#63;.
455            *
456            * @param actionId the action ID
457            * @param resourceId the resource ID
458            * @return the number of matching permissions
459            * @throws SystemException if a system exception occurred
460            */
461            public static int countByA_R(java.lang.String actionId, long resourceId)
462                    throws com.liferay.portal.kernel.exception.SystemException {
463                    return getPersistence().countByA_R(actionId, resourceId);
464            }
465    
466            /**
467            * Returns the number of permissions.
468            *
469            * @return the number of permissions
470            * @throws SystemException if a system exception occurred
471            */
472            public static int countAll()
473                    throws com.liferay.portal.kernel.exception.SystemException {
474                    return getPersistence().countAll();
475            }
476    
477            /**
478            * Returns all the groups associated with the permission.
479            *
480            * @param pk the primary key of the permission
481            * @return the groups associated with the permission
482            * @throws SystemException if a system exception occurred
483            */
484            public static java.util.List<com.liferay.portal.model.Group> getGroups(
485                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
486                    return getPersistence().getGroups(pk);
487            }
488    
489            /**
490            * Returns a range of all the groups associated with the permission.
491            *
492            * <p>
493            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
494            * </p>
495            *
496            * @param pk the primary key of the permission
497            * @param start the lower bound of the range of permissions
498            * @param end the upper bound of the range of permissions (not inclusive)
499            * @return the range of groups associated with the permission
500            * @throws SystemException if a system exception occurred
501            */
502            public static java.util.List<com.liferay.portal.model.Group> getGroups(
503                    long pk, int start, int end)
504                    throws com.liferay.portal.kernel.exception.SystemException {
505                    return getPersistence().getGroups(pk, start, end);
506            }
507    
508            /**
509            * Returns an ordered range of all the groups associated with the permission.
510            *
511            * <p>
512            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
513            * </p>
514            *
515            * @param pk the primary key of the permission
516            * @param start the lower bound of the range of permissions
517            * @param end the upper bound of the range of permissions (not inclusive)
518            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
519            * @return the ordered range of groups associated with the permission
520            * @throws SystemException if a system exception occurred
521            */
522            public static java.util.List<com.liferay.portal.model.Group> getGroups(
523                    long pk, int start, int end,
524                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
525                    throws com.liferay.portal.kernel.exception.SystemException {
526                    return getPersistence().getGroups(pk, start, end, orderByComparator);
527            }
528    
529            /**
530            * Returns the number of groups associated with the permission.
531            *
532            * @param pk the primary key of the permission
533            * @return the number of groups associated with the permission
534            * @throws SystemException if a system exception occurred
535            */
536            public static int getGroupsSize(long pk)
537                    throws com.liferay.portal.kernel.exception.SystemException {
538                    return getPersistence().getGroupsSize(pk);
539            }
540    
541            /**
542            * Returns <code>true</code> if the group is associated with the permission.
543            *
544            * @param pk the primary key of the permission
545            * @param groupPK the primary key of the group
546            * @return <code>true</code> if the group is associated with the permission; <code>false</code> otherwise
547            * @throws SystemException if a system exception occurred
548            */
549            public static boolean containsGroup(long pk, long groupPK)
550                    throws com.liferay.portal.kernel.exception.SystemException {
551                    return getPersistence().containsGroup(pk, groupPK);
552            }
553    
554            /**
555            * Returns <code>true</code> if the permission has any groups associated with it.
556            *
557            * @param pk the primary key of the permission to check for associations with groups
558            * @return <code>true</code> if the permission has any groups associated with it; <code>false</code> otherwise
559            * @throws SystemException if a system exception occurred
560            */
561            public static boolean containsGroups(long pk)
562                    throws com.liferay.portal.kernel.exception.SystemException {
563                    return getPersistence().containsGroups(pk);
564            }
565    
566            /**
567            * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
568            *
569            * @param pk the primary key of the permission
570            * @param groupPK the primary key of the group
571            * @throws SystemException if a system exception occurred
572            */
573            public static void addGroup(long pk, long groupPK)
574                    throws com.liferay.portal.kernel.exception.SystemException {
575                    getPersistence().addGroup(pk, groupPK);
576            }
577    
578            /**
579            * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
580            *
581            * @param pk the primary key of the permission
582            * @param group the group
583            * @throws SystemException if a system exception occurred
584            */
585            public static void addGroup(long pk, com.liferay.portal.model.Group group)
586                    throws com.liferay.portal.kernel.exception.SystemException {
587                    getPersistence().addGroup(pk, group);
588            }
589    
590            /**
591            * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
592            *
593            * @param pk the primary key of the permission
594            * @param groupPKs the primary keys of the groups
595            * @throws SystemException if a system exception occurred
596            */
597            public static void addGroups(long pk, long[] groupPKs)
598                    throws com.liferay.portal.kernel.exception.SystemException {
599                    getPersistence().addGroups(pk, groupPKs);
600            }
601    
602            /**
603            * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
604            *
605            * @param pk the primary key of the permission
606            * @param groups the groups
607            * @throws SystemException if a system exception occurred
608            */
609            public static void addGroups(long pk,
610                    java.util.List<com.liferay.portal.model.Group> groups)
611                    throws com.liferay.portal.kernel.exception.SystemException {
612                    getPersistence().addGroups(pk, groups);
613            }
614    
615            /**
616            * Clears all associations between the permission and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
617            *
618            * @param pk the primary key of the permission to clear the associated groups from
619            * @throws SystemException if a system exception occurred
620            */
621            public static void clearGroups(long pk)
622                    throws com.liferay.portal.kernel.exception.SystemException {
623                    getPersistence().clearGroups(pk);
624            }
625    
626            /**
627            * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
628            *
629            * @param pk the primary key of the permission
630            * @param groupPK the primary key of the group
631            * @throws SystemException if a system exception occurred
632            */
633            public static void removeGroup(long pk, long groupPK)
634                    throws com.liferay.portal.kernel.exception.SystemException {
635                    getPersistence().removeGroup(pk, groupPK);
636            }
637    
638            /**
639            * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
640            *
641            * @param pk the primary key of the permission
642            * @param group the group
643            * @throws SystemException if a system exception occurred
644            */
645            public static void removeGroup(long pk, com.liferay.portal.model.Group group)
646                    throws com.liferay.portal.kernel.exception.SystemException {
647                    getPersistence().removeGroup(pk, group);
648            }
649    
650            /**
651            * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
652            *
653            * @param pk the primary key of the permission
654            * @param groupPKs the primary keys of the groups
655            * @throws SystemException if a system exception occurred
656            */
657            public static void removeGroups(long pk, long[] groupPKs)
658                    throws com.liferay.portal.kernel.exception.SystemException {
659                    getPersistence().removeGroups(pk, groupPKs);
660            }
661    
662            /**
663            * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
664            *
665            * @param pk the primary key of the permission
666            * @param groups the groups
667            * @throws SystemException if a system exception occurred
668            */
669            public static void removeGroups(long pk,
670                    java.util.List<com.liferay.portal.model.Group> groups)
671                    throws com.liferay.portal.kernel.exception.SystemException {
672                    getPersistence().removeGroups(pk, groups);
673            }
674    
675            /**
676            * Sets the groups associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
677            *
678            * @param pk the primary key of the permission
679            * @param groupPKs the primary keys of the groups to be associated with the permission
680            * @throws SystemException if a system exception occurred
681            */
682            public static void setGroups(long pk, long[] groupPKs)
683                    throws com.liferay.portal.kernel.exception.SystemException {
684                    getPersistence().setGroups(pk, groupPKs);
685            }
686    
687            /**
688            * Sets the groups associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
689            *
690            * @param pk the primary key of the permission
691            * @param groups the groups to be associated with the permission
692            * @throws SystemException if a system exception occurred
693            */
694            public static void setGroups(long pk,
695                    java.util.List<com.liferay.portal.model.Group> groups)
696                    throws com.liferay.portal.kernel.exception.SystemException {
697                    getPersistence().setGroups(pk, groups);
698            }
699    
700            /**
701            * Returns all the roles associated with the permission.
702            *
703            * @param pk the primary key of the permission
704            * @return the roles associated with the permission
705            * @throws SystemException if a system exception occurred
706            */
707            public static java.util.List<com.liferay.portal.model.Role> getRoles(
708                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
709                    return getPersistence().getRoles(pk);
710            }
711    
712            /**
713            * Returns a range of all the roles associated with the permission.
714            *
715            * <p>
716            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
717            * </p>
718            *
719            * @param pk the primary key of the permission
720            * @param start the lower bound of the range of permissions
721            * @param end the upper bound of the range of permissions (not inclusive)
722            * @return the range of roles associated with the permission
723            * @throws SystemException if a system exception occurred
724            */
725            public static java.util.List<com.liferay.portal.model.Role> getRoles(
726                    long pk, int start, int end)
727                    throws com.liferay.portal.kernel.exception.SystemException {
728                    return getPersistence().getRoles(pk, start, end);
729            }
730    
731            /**
732            * Returns an ordered range of all the roles associated with the permission.
733            *
734            * <p>
735            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
736            * </p>
737            *
738            * @param pk the primary key of the permission
739            * @param start the lower bound of the range of permissions
740            * @param end the upper bound of the range of permissions (not inclusive)
741            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
742            * @return the ordered range of roles associated with the permission
743            * @throws SystemException if a system exception occurred
744            */
745            public static java.util.List<com.liferay.portal.model.Role> getRoles(
746                    long pk, int start, int end,
747                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
748                    throws com.liferay.portal.kernel.exception.SystemException {
749                    return getPersistence().getRoles(pk, start, end, orderByComparator);
750            }
751    
752            /**
753            * Returns the number of roles associated with the permission.
754            *
755            * @param pk the primary key of the permission
756            * @return the number of roles associated with the permission
757            * @throws SystemException if a system exception occurred
758            */
759            public static int getRolesSize(long pk)
760                    throws com.liferay.portal.kernel.exception.SystemException {
761                    return getPersistence().getRolesSize(pk);
762            }
763    
764            /**
765            * Returns <code>true</code> if the role is associated with the permission.
766            *
767            * @param pk the primary key of the permission
768            * @param rolePK the primary key of the role
769            * @return <code>true</code> if the role is associated with the permission; <code>false</code> otherwise
770            * @throws SystemException if a system exception occurred
771            */
772            public static boolean containsRole(long pk, long rolePK)
773                    throws com.liferay.portal.kernel.exception.SystemException {
774                    return getPersistence().containsRole(pk, rolePK);
775            }
776    
777            /**
778            * Returns <code>true</code> if the permission has any roles associated with it.
779            *
780            * @param pk the primary key of the permission to check for associations with roles
781            * @return <code>true</code> if the permission has any roles associated with it; <code>false</code> otherwise
782            * @throws SystemException if a system exception occurred
783            */
784            public static boolean containsRoles(long pk)
785                    throws com.liferay.portal.kernel.exception.SystemException {
786                    return getPersistence().containsRoles(pk);
787            }
788    
789            /**
790            * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
791            *
792            * @param pk the primary key of the permission
793            * @param rolePK the primary key of the role
794            * @throws SystemException if a system exception occurred
795            */
796            public static void addRole(long pk, long rolePK)
797                    throws com.liferay.portal.kernel.exception.SystemException {
798                    getPersistence().addRole(pk, rolePK);
799            }
800    
801            /**
802            * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
803            *
804            * @param pk the primary key of the permission
805            * @param role the role
806            * @throws SystemException if a system exception occurred
807            */
808            public static void addRole(long pk, com.liferay.portal.model.Role role)
809                    throws com.liferay.portal.kernel.exception.SystemException {
810                    getPersistence().addRole(pk, role);
811            }
812    
813            /**
814            * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
815            *
816            * @param pk the primary key of the permission
817            * @param rolePKs the primary keys of the roles
818            * @throws SystemException if a system exception occurred
819            */
820            public static void addRoles(long pk, long[] rolePKs)
821                    throws com.liferay.portal.kernel.exception.SystemException {
822                    getPersistence().addRoles(pk, rolePKs);
823            }
824    
825            /**
826            * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
827            *
828            * @param pk the primary key of the permission
829            * @param roles the roles
830            * @throws SystemException if a system exception occurred
831            */
832            public static void addRoles(long pk,
833                    java.util.List<com.liferay.portal.model.Role> roles)
834                    throws com.liferay.portal.kernel.exception.SystemException {
835                    getPersistence().addRoles(pk, roles);
836            }
837    
838            /**
839            * Clears all associations between the permission and its roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
840            *
841            * @param pk the primary key of the permission to clear the associated roles from
842            * @throws SystemException if a system exception occurred
843            */
844            public static void clearRoles(long pk)
845                    throws com.liferay.portal.kernel.exception.SystemException {
846                    getPersistence().clearRoles(pk);
847            }
848    
849            /**
850            * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
851            *
852            * @param pk the primary key of the permission
853            * @param rolePK the primary key of the role
854            * @throws SystemException if a system exception occurred
855            */
856            public static void removeRole(long pk, long rolePK)
857                    throws com.liferay.portal.kernel.exception.SystemException {
858                    getPersistence().removeRole(pk, rolePK);
859            }
860    
861            /**
862            * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache.
863            *
864            * @param pk the primary key of the permission
865            * @param role the role
866            * @throws SystemException if a system exception occurred
867            */
868            public static void removeRole(long pk, com.liferay.portal.model.Role role)
869                    throws com.liferay.portal.kernel.exception.SystemException {
870                    getPersistence().removeRole(pk, role);
871            }
872    
873            /**
874            * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
875            *
876            * @param pk the primary key of the permission
877            * @param rolePKs the primary keys of the roles
878            * @throws SystemException if a system exception occurred
879            */
880            public static void removeRoles(long pk, long[] rolePKs)
881                    throws com.liferay.portal.kernel.exception.SystemException {
882                    getPersistence().removeRoles(pk, rolePKs);
883            }
884    
885            /**
886            * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache.
887            *
888            * @param pk the primary key of the permission
889            * @param roles the roles
890            * @throws SystemException if a system exception occurred
891            */
892            public static void removeRoles(long pk,
893                    java.util.List<com.liferay.portal.model.Role> roles)
894                    throws com.liferay.portal.kernel.exception.SystemException {
895                    getPersistence().removeRoles(pk, roles);
896            }
897    
898            /**
899            * Sets the roles associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
900            *
901            * @param pk the primary key of the permission
902            * @param rolePKs the primary keys of the roles to be associated with the permission
903            * @throws SystemException if a system exception occurred
904            */
905            public static void setRoles(long pk, long[] rolePKs)
906                    throws com.liferay.portal.kernel.exception.SystemException {
907                    getPersistence().setRoles(pk, rolePKs);
908            }
909    
910            /**
911            * Sets the roles associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
912            *
913            * @param pk the primary key of the permission
914            * @param roles the roles to be associated with the permission
915            * @throws SystemException if a system exception occurred
916            */
917            public static void setRoles(long pk,
918                    java.util.List<com.liferay.portal.model.Role> roles)
919                    throws com.liferay.portal.kernel.exception.SystemException {
920                    getPersistence().setRoles(pk, roles);
921            }
922    
923            /**
924            * Returns all the users associated with the permission.
925            *
926            * @param pk the primary key of the permission
927            * @return the users associated with the permission
928            * @throws SystemException if a system exception occurred
929            */
930            public static java.util.List<com.liferay.portal.model.User> getUsers(
931                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
932                    return getPersistence().getUsers(pk);
933            }
934    
935            /**
936            * Returns a range of all the users associated with the permission.
937            *
938            * <p>
939            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
940            * </p>
941            *
942            * @param pk the primary key of the permission
943            * @param start the lower bound of the range of permissions
944            * @param end the upper bound of the range of permissions (not inclusive)
945            * @return the range of users associated with the permission
946            * @throws SystemException if a system exception occurred
947            */
948            public static java.util.List<com.liferay.portal.model.User> getUsers(
949                    long pk, int start, int end)
950                    throws com.liferay.portal.kernel.exception.SystemException {
951                    return getPersistence().getUsers(pk, start, end);
952            }
953    
954            /**
955            * Returns an ordered range of all the users associated with the permission.
956            *
957            * <p>
958            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
959            * </p>
960            *
961            * @param pk the primary key of the permission
962            * @param start the lower bound of the range of permissions
963            * @param end the upper bound of the range of permissions (not inclusive)
964            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
965            * @return the ordered range of users associated with the permission
966            * @throws SystemException if a system exception occurred
967            */
968            public static java.util.List<com.liferay.portal.model.User> getUsers(
969                    long pk, int start, int end,
970                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
971                    throws com.liferay.portal.kernel.exception.SystemException {
972                    return getPersistence().getUsers(pk, start, end, orderByComparator);
973            }
974    
975            /**
976            * Returns the number of users associated with the permission.
977            *
978            * @param pk the primary key of the permission
979            * @return the number of users associated with the permission
980            * @throws SystemException if a system exception occurred
981            */
982            public static int getUsersSize(long pk)
983                    throws com.liferay.portal.kernel.exception.SystemException {
984                    return getPersistence().getUsersSize(pk);
985            }
986    
987            /**
988            * Returns <code>true</code> if the user is associated with the permission.
989            *
990            * @param pk the primary key of the permission
991            * @param userPK the primary key of the user
992            * @return <code>true</code> if the user is associated with the permission; <code>false</code> otherwise
993            * @throws SystemException if a system exception occurred
994            */
995            public static boolean containsUser(long pk, long userPK)
996                    throws com.liferay.portal.kernel.exception.SystemException {
997                    return getPersistence().containsUser(pk, userPK);
998            }
999    
1000            /**
1001            * Returns <code>true</code> if the permission has any users associated with it.
1002            *
1003            * @param pk the primary key of the permission to check for associations with users
1004            * @return <code>true</code> if the permission has any users associated with it; <code>false</code> otherwise
1005            * @throws SystemException if a system exception occurred
1006            */
1007            public static boolean containsUsers(long pk)
1008                    throws com.liferay.portal.kernel.exception.SystemException {
1009                    return getPersistence().containsUsers(pk);
1010            }
1011    
1012            /**
1013            * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1014            *
1015            * @param pk the primary key of the permission
1016            * @param userPK the primary key of the user
1017            * @throws SystemException if a system exception occurred
1018            */
1019            public static void addUser(long pk, long userPK)
1020                    throws com.liferay.portal.kernel.exception.SystemException {
1021                    getPersistence().addUser(pk, userPK);
1022            }
1023    
1024            /**
1025            * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1026            *
1027            * @param pk the primary key of the permission
1028            * @param user the user
1029            * @throws SystemException if a system exception occurred
1030            */
1031            public static void addUser(long pk, com.liferay.portal.model.User user)
1032                    throws com.liferay.portal.kernel.exception.SystemException {
1033                    getPersistence().addUser(pk, user);
1034            }
1035    
1036            /**
1037            * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1038            *
1039            * @param pk the primary key of the permission
1040            * @param userPKs the primary keys of the users
1041            * @throws SystemException if a system exception occurred
1042            */
1043            public static void addUsers(long pk, long[] userPKs)
1044                    throws com.liferay.portal.kernel.exception.SystemException {
1045                    getPersistence().addUsers(pk, userPKs);
1046            }
1047    
1048            /**
1049            * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1050            *
1051            * @param pk the primary key of the permission
1052            * @param users the users
1053            * @throws SystemException if a system exception occurred
1054            */
1055            public static void addUsers(long pk,
1056                    java.util.List<com.liferay.portal.model.User> users)
1057                    throws com.liferay.portal.kernel.exception.SystemException {
1058                    getPersistence().addUsers(pk, users);
1059            }
1060    
1061            /**
1062            * Clears all associations between the permission and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1063            *
1064            * @param pk the primary key of the permission to clear the associated users from
1065            * @throws SystemException if a system exception occurred
1066            */
1067            public static void clearUsers(long pk)
1068                    throws com.liferay.portal.kernel.exception.SystemException {
1069                    getPersistence().clearUsers(pk);
1070            }
1071    
1072            /**
1073            * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1074            *
1075            * @param pk the primary key of the permission
1076            * @param userPK the primary key of the user
1077            * @throws SystemException if a system exception occurred
1078            */
1079            public static void removeUser(long pk, long userPK)
1080                    throws com.liferay.portal.kernel.exception.SystemException {
1081                    getPersistence().removeUser(pk, userPK);
1082            }
1083    
1084            /**
1085            * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1086            *
1087            * @param pk the primary key of the permission
1088            * @param user the user
1089            * @throws SystemException if a system exception occurred
1090            */
1091            public static void removeUser(long pk, com.liferay.portal.model.User user)
1092                    throws com.liferay.portal.kernel.exception.SystemException {
1093                    getPersistence().removeUser(pk, user);
1094            }
1095    
1096            /**
1097            * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1098            *
1099            * @param pk the primary key of the permission
1100            * @param userPKs the primary keys of the users
1101            * @throws SystemException if a system exception occurred
1102            */
1103            public static void removeUsers(long pk, long[] userPKs)
1104                    throws com.liferay.portal.kernel.exception.SystemException {
1105                    getPersistence().removeUsers(pk, userPKs);
1106            }
1107    
1108            /**
1109            * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1110            *
1111            * @param pk the primary key of the permission
1112            * @param users the users
1113            * @throws SystemException if a system exception occurred
1114            */
1115            public static void removeUsers(long pk,
1116                    java.util.List<com.liferay.portal.model.User> users)
1117                    throws com.liferay.portal.kernel.exception.SystemException {
1118                    getPersistence().removeUsers(pk, users);
1119            }
1120    
1121            /**
1122            * Sets the users associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1123            *
1124            * @param pk the primary key of the permission
1125            * @param userPKs the primary keys of the users to be associated with the permission
1126            * @throws SystemException if a system exception occurred
1127            */
1128            public static void setUsers(long pk, long[] userPKs)
1129                    throws com.liferay.portal.kernel.exception.SystemException {
1130                    getPersistence().setUsers(pk, userPKs);
1131            }
1132    
1133            /**
1134            * Sets the users associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1135            *
1136            * @param pk the primary key of the permission
1137            * @param users the users to be associated with the permission
1138            * @throws SystemException if a system exception occurred
1139            */
1140            public static void setUsers(long pk,
1141                    java.util.List<com.liferay.portal.model.User> users)
1142                    throws com.liferay.portal.kernel.exception.SystemException {
1143                    getPersistence().setUsers(pk, users);
1144            }
1145    
1146            public static PermissionPersistence getPersistence() {
1147                    if (_persistence == null) {
1148                            _persistence = (PermissionPersistence)PortalBeanLocatorUtil.locate(PermissionPersistence.class.getName());
1149    
1150                            ReferenceRegistry.registerReference(PermissionUtil.class,
1151                                    "_persistence");
1152                    }
1153    
1154                    return _persistence;
1155            }
1156    
1157            public void setPersistence(PermissionPersistence persistence) {
1158                    _persistence = persistence;
1159    
1160                    ReferenceRegistry.registerReference(PermissionUtil.class, "_persistence");
1161            }
1162    
1163            private static PermissionPersistence _persistence;
1164    }