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