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