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