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