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.ResourcePermission;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the resource permission service. This utility wraps {@link ResourcePermissionPersistenceImpl} 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 ResourcePermissionPersistence
039     * @see ResourcePermissionPersistenceImpl
040     * @generated
041     */
042    public class ResourcePermissionUtil {
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(ResourcePermission resourcePermission) {
054                    getPersistence().clearCache(resourcePermission);
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<ResourcePermission> 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<ResourcePermission> 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<ResourcePermission> 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 ResourcePermission remove(
097                    ResourcePermission resourcePermission) throws SystemException {
098                    return getPersistence().remove(resourcePermission);
099            }
100    
101            /**
102             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
103             */
104            public static ResourcePermission update(
105                    ResourcePermission resourcePermission, boolean merge)
106                    throws SystemException {
107                    return getPersistence().update(resourcePermission, merge);
108            }
109    
110            /**
111             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
112             */
113            public static ResourcePermission update(
114                    ResourcePermission resourcePermission, boolean merge,
115                    ServiceContext serviceContext) throws SystemException {
116                    return getPersistence().update(resourcePermission, merge, serviceContext);
117            }
118    
119            /**
120            * Caches the resource permission in the entity cache if it is enabled.
121            *
122            * @param resourcePermission the resource permission to cache
123            */
124            public static void cacheResult(
125                    com.liferay.portal.model.ResourcePermission resourcePermission) {
126                    getPersistence().cacheResult(resourcePermission);
127            }
128    
129            /**
130            * Caches the resource permissions in the entity cache if it is enabled.
131            *
132            * @param resourcePermissions the resource permissions to cache
133            */
134            public static void cacheResult(
135                    java.util.List<com.liferay.portal.model.ResourcePermission> resourcePermissions) {
136                    getPersistence().cacheResult(resourcePermissions);
137            }
138    
139            /**
140            * Creates a new resource permission with the primary key. Does not add the resource permission to the database.
141            *
142            * @param resourcePermissionId the primary key for the new resource permission
143            * @return the new resource permission
144            */
145            public static com.liferay.portal.model.ResourcePermission create(
146                    long resourcePermissionId) {
147                    return getPersistence().create(resourcePermissionId);
148            }
149    
150            /**
151            * Removes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.
152            *
153            * @param resourcePermissionId the primary key of the resource permission to remove
154            * @return the resource permission that was removed
155            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
156            * @throws SystemException if a system exception occurred
157            */
158            public static com.liferay.portal.model.ResourcePermission remove(
159                    long resourcePermissionId)
160                    throws com.liferay.portal.NoSuchResourcePermissionException,
161                            com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().remove(resourcePermissionId);
163            }
164    
165            public static com.liferay.portal.model.ResourcePermission updateImpl(
166                    com.liferay.portal.model.ResourcePermission resourcePermission,
167                    boolean merge)
168                    throws com.liferay.portal.kernel.exception.SystemException {
169                    return getPersistence().updateImpl(resourcePermission, merge);
170            }
171    
172            /**
173            * Finds the resource permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourcePermissionException} if it could not be found.
174            *
175            * @param resourcePermissionId the primary key of the resource permission to find
176            * @return the resource permission
177            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
178            * @throws SystemException if a system exception occurred
179            */
180            public static com.liferay.portal.model.ResourcePermission findByPrimaryKey(
181                    long resourcePermissionId)
182                    throws com.liferay.portal.NoSuchResourcePermissionException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getPersistence().findByPrimaryKey(resourcePermissionId);
185            }
186    
187            /**
188            * Finds the resource permission with the primary key or returns <code>null</code> if it could not be found.
189            *
190            * @param resourcePermissionId the primary key of the resource permission to find
191            * @return the resource permission, or <code>null</code> if a resource permission with the primary key could not be found
192            * @throws SystemException if a system exception occurred
193            */
194            public static com.liferay.portal.model.ResourcePermission fetchByPrimaryKey(
195                    long resourcePermissionId)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getPersistence().fetchByPrimaryKey(resourcePermissionId);
198            }
199    
200            /**
201            * Finds all the resource permissions where roleId = &#63;.
202            *
203            * @param roleId the role id to search with
204            * @return the matching resource permissions
205            * @throws SystemException if a system exception occurred
206            */
207            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
208                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
209                    return getPersistence().findByRoleId(roleId);
210            }
211    
212            /**
213            * Finds a range of all the resource permissions where roleId = &#63;.
214            *
215            * <p>
216            * 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.
217            * </p>
218            *
219            * @param roleId the role id to search with
220            * @param start the lower bound of the range of resource permissions to return
221            * @param end the upper bound of the range of resource permissions to return (not inclusive)
222            * @return the range of matching resource permissions
223            * @throws SystemException if a system exception occurred
224            */
225            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
226                    long roleId, int start, int end)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().findByRoleId(roleId, start, end);
229            }
230    
231            /**
232            * Finds an ordered range of all the resource permissions where roleId = &#63;.
233            *
234            * <p>
235            * 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.
236            * </p>
237            *
238            * @param roleId the role id to search with
239            * @param start the lower bound of the range of resource permissions to return
240            * @param end the upper bound of the range of resource permissions to return (not inclusive)
241            * @param orderByComparator the comparator to order the results by
242            * @return the ordered range of matching resource permissions
243            * @throws SystemException if a system exception occurred
244            */
245            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
246                    long roleId, int start, int end,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.kernel.exception.SystemException {
249                    return getPersistence()
250                                       .findByRoleId(roleId, start, end, orderByComparator);
251            }
252    
253            /**
254            * Finds the first resource permission in the ordered set where roleId = &#63;.
255            *
256            * <p>
257            * 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.
258            * </p>
259            *
260            * @param roleId the role id to search with
261            * @param orderByComparator the comparator to order the set by
262            * @return the first matching resource permission
263            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
264            * @throws SystemException if a system exception occurred
265            */
266            public static com.liferay.portal.model.ResourcePermission findByRoleId_First(
267                    long roleId,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.NoSuchResourcePermissionException,
270                            com.liferay.portal.kernel.exception.SystemException {
271                    return getPersistence().findByRoleId_First(roleId, orderByComparator);
272            }
273    
274            /**
275            * Finds the last resource permission in the ordered set where roleId = &#63;.
276            *
277            * <p>
278            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
279            * </p>
280            *
281            * @param roleId the role id to search with
282            * @param orderByComparator the comparator to order the set by
283            * @return the last matching resource permission
284            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
285            * @throws SystemException if a system exception occurred
286            */
287            public static com.liferay.portal.model.ResourcePermission findByRoleId_Last(
288                    long roleId,
289                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
290                    throws com.liferay.portal.NoSuchResourcePermissionException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    return getPersistence().findByRoleId_Last(roleId, orderByComparator);
293            }
294    
295            /**
296            * Finds the resource permissions before and after the current resource permission in the ordered set where roleId = &#63;.
297            *
298            * <p>
299            * 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.
300            * </p>
301            *
302            * @param resourcePermissionId the primary key of the current resource permission
303            * @param roleId the role id to search with
304            * @param orderByComparator the comparator to order the set by
305            * @return the previous, current, and next resource permission
306            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
307            * @throws SystemException if a system exception occurred
308            */
309            public static com.liferay.portal.model.ResourcePermission[] findByRoleId_PrevAndNext(
310                    long resourcePermissionId, long roleId,
311                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
312                    throws com.liferay.portal.NoSuchResourcePermissionException,
313                            com.liferay.portal.kernel.exception.SystemException {
314                    return getPersistence()
315                                       .findByRoleId_PrevAndNext(resourcePermissionId, roleId,
316                            orderByComparator);
317            }
318    
319            /**
320            * Finds all the resource permissions where roleId = &#63; and scope = &#63;.
321            *
322            * @param roleId the role id to search with
323            * @param scope the scope to search with
324            * @return the matching resource permissions
325            * @throws SystemException if a system exception occurred
326            */
327            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
328                    long roleId, int scope)
329                    throws com.liferay.portal.kernel.exception.SystemException {
330                    return getPersistence().findByR_S(roleId, scope);
331            }
332    
333            /**
334            * Finds a range of all the resource permissions where roleId = &#63; and scope = &#63;.
335            *
336            * <p>
337            * 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.
338            * </p>
339            *
340            * @param roleId the role id to search with
341            * @param scope the scope to search with
342            * @param start the lower bound of the range of resource permissions to return
343            * @param end the upper bound of the range of resource permissions to return (not inclusive)
344            * @return the range of matching resource permissions
345            * @throws SystemException if a system exception occurred
346            */
347            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
348                    long roleId, int scope, int start, int end)
349                    throws com.liferay.portal.kernel.exception.SystemException {
350                    return getPersistence().findByR_S(roleId, scope, start, end);
351            }
352    
353            /**
354            * Finds an ordered range of all the resource permissions where roleId = &#63; and scope = &#63;.
355            *
356            * <p>
357            * 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.
358            * </p>
359            *
360            * @param roleId the role id to search with
361            * @param scope the scope to search with
362            * @param start the lower bound of the range of resource permissions to return
363            * @param end the upper bound of the range of resource permissions to return (not inclusive)
364            * @param orderByComparator the comparator to order the results by
365            * @return the ordered range of matching resource permissions
366            * @throws SystemException if a system exception occurred
367            */
368            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
369                    long roleId, int scope, int start, int end,
370                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
371                    throws com.liferay.portal.kernel.exception.SystemException {
372                    return getPersistence()
373                                       .findByR_S(roleId, scope, start, end, orderByComparator);
374            }
375    
376            /**
377            * Finds the first resource permission in the ordered set where roleId = &#63; and scope = &#63;.
378            *
379            * <p>
380            * 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.
381            * </p>
382            *
383            * @param roleId the role id to search with
384            * @param scope the scope to search with
385            * @param orderByComparator the comparator to order the set by
386            * @return the first matching resource permission
387            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
388            * @throws SystemException if a system exception occurred
389            */
390            public static com.liferay.portal.model.ResourcePermission findByR_S_First(
391                    long roleId, int scope,
392                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
393                    throws com.liferay.portal.NoSuchResourcePermissionException,
394                            com.liferay.portal.kernel.exception.SystemException {
395                    return getPersistence().findByR_S_First(roleId, scope, orderByComparator);
396            }
397    
398            /**
399            * Finds the last resource permission in the ordered set where roleId = &#63; and scope = &#63;.
400            *
401            * <p>
402            * 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.
403            * </p>
404            *
405            * @param roleId the role id to search with
406            * @param scope the scope to search with
407            * @param orderByComparator the comparator to order the set by
408            * @return the last matching resource permission
409            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
410            * @throws SystemException if a system exception occurred
411            */
412            public static com.liferay.portal.model.ResourcePermission findByR_S_Last(
413                    long roleId, int scope,
414                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
415                    throws com.liferay.portal.NoSuchResourcePermissionException,
416                            com.liferay.portal.kernel.exception.SystemException {
417                    return getPersistence().findByR_S_Last(roleId, scope, orderByComparator);
418            }
419    
420            /**
421            * Finds the resource permissions before and after the current resource permission in the ordered set where roleId = &#63; and scope = &#63;.
422            *
423            * <p>
424            * 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.
425            * </p>
426            *
427            * @param resourcePermissionId the primary key of the current resource permission
428            * @param roleId the role id to search with
429            * @param scope the scope to search with
430            * @param orderByComparator the comparator to order the set by
431            * @return the previous, current, and next resource permission
432            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
433            * @throws SystemException if a system exception occurred
434            */
435            public static com.liferay.portal.model.ResourcePermission[] findByR_S_PrevAndNext(
436                    long resourcePermissionId, long roleId, int scope,
437                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
438                    throws com.liferay.portal.NoSuchResourcePermissionException,
439                            com.liferay.portal.kernel.exception.SystemException {
440                    return getPersistence()
441                                       .findByR_S_PrevAndNext(resourcePermissionId, roleId, scope,
442                            orderByComparator);
443            }
444    
445            /**
446            * Finds all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
447            *
448            * @param companyId the company id to search with
449            * @param name the name to search with
450            * @param scope the scope to search with
451            * @return the matching resource permissions
452            * @throws SystemException if a system exception occurred
453            */
454            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
455                    long companyId, java.lang.String name, int scope)
456                    throws com.liferay.portal.kernel.exception.SystemException {
457                    return getPersistence().findByC_N_S(companyId, name, scope);
458            }
459    
460            /**
461            * Finds a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
462            *
463            * <p>
464            * 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.
465            * </p>
466            *
467            * @param companyId the company id to search with
468            * @param name the name to search with
469            * @param scope the scope to search with
470            * @param start the lower bound of the range of resource permissions to return
471            * @param end the upper bound of the range of resource permissions to return (not inclusive)
472            * @return the range of matching resource permissions
473            * @throws SystemException if a system exception occurred
474            */
475            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
476                    long companyId, java.lang.String name, int scope, int start, int end)
477                    throws com.liferay.portal.kernel.exception.SystemException {
478                    return getPersistence().findByC_N_S(companyId, name, scope, start, end);
479            }
480    
481            /**
482            * Finds an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
483            *
484            * <p>
485            * 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.
486            * </p>
487            *
488            * @param companyId the company id to search with
489            * @param name the name to search with
490            * @param scope the scope to search with
491            * @param start the lower bound of the range of resource permissions to return
492            * @param end the upper bound of the range of resource permissions to return (not inclusive)
493            * @param orderByComparator the comparator to order the results by
494            * @return the ordered range of matching resource permissions
495            * @throws SystemException if a system exception occurred
496            */
497            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
498                    long companyId, java.lang.String name, int scope, int start, int end,
499                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
500                    throws com.liferay.portal.kernel.exception.SystemException {
501                    return getPersistence()
502                                       .findByC_N_S(companyId, name, scope, start, end,
503                            orderByComparator);
504            }
505    
506            /**
507            * Finds the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
508            *
509            * <p>
510            * 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.
511            * </p>
512            *
513            * @param companyId the company id to search with
514            * @param name the name to search with
515            * @param scope the scope to search with
516            * @param orderByComparator the comparator to order the set by
517            * @return the first matching resource permission
518            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
519            * @throws SystemException if a system exception occurred
520            */
521            public static com.liferay.portal.model.ResourcePermission findByC_N_S_First(
522                    long companyId, java.lang.String name, int scope,
523                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
524                    throws com.liferay.portal.NoSuchResourcePermissionException,
525                            com.liferay.portal.kernel.exception.SystemException {
526                    return getPersistence()
527                                       .findByC_N_S_First(companyId, name, scope, orderByComparator);
528            }
529    
530            /**
531            * Finds the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
532            *
533            * <p>
534            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
535            * </p>
536            *
537            * @param companyId the company id to search with
538            * @param name the name to search with
539            * @param scope the scope to search with
540            * @param orderByComparator the comparator to order the set by
541            * @return the last matching resource permission
542            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
543            * @throws SystemException if a system exception occurred
544            */
545            public static com.liferay.portal.model.ResourcePermission findByC_N_S_Last(
546                    long companyId, java.lang.String name, int scope,
547                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
548                    throws com.liferay.portal.NoSuchResourcePermissionException,
549                            com.liferay.portal.kernel.exception.SystemException {
550                    return getPersistence()
551                                       .findByC_N_S_Last(companyId, name, scope, orderByComparator);
552            }
553    
554            /**
555            * Finds the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
556            *
557            * <p>
558            * 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.
559            * </p>
560            *
561            * @param resourcePermissionId the primary key of the current resource permission
562            * @param companyId the company id to search with
563            * @param name the name to search with
564            * @param scope the scope to search with
565            * @param orderByComparator the comparator to order the set by
566            * @return the previous, current, and next resource permission
567            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
568            * @throws SystemException if a system exception occurred
569            */
570            public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_PrevAndNext(
571                    long resourcePermissionId, long companyId, java.lang.String name,
572                    int scope,
573                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
574                    throws com.liferay.portal.NoSuchResourcePermissionException,
575                            com.liferay.portal.kernel.exception.SystemException {
576                    return getPersistence()
577                                       .findByC_N_S_PrevAndNext(resourcePermissionId, companyId,
578                            name, scope, orderByComparator);
579            }
580    
581            /**
582            * Finds all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
583            *
584            * @param companyId the company id to search with
585            * @param name the name to search with
586            * @param scope the scope to search with
587            * @param primKey the prim key to search with
588            * @return the matching resource permissions
589            * @throws SystemException if a system exception occurred
590            */
591            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
592                    long companyId, java.lang.String name, int scope,
593                    java.lang.String primKey)
594                    throws com.liferay.portal.kernel.exception.SystemException {
595                    return getPersistence().findByC_N_S_P(companyId, name, scope, primKey);
596            }
597    
598            /**
599            * Finds a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
600            *
601            * <p>
602            * 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.
603            * </p>
604            *
605            * @param companyId the company id to search with
606            * @param name the name to search with
607            * @param scope the scope to search with
608            * @param primKey the prim key to search with
609            * @param start the lower bound of the range of resource permissions to return
610            * @param end the upper bound of the range of resource permissions to return (not inclusive)
611            * @return the range of matching resource permissions
612            * @throws SystemException if a system exception occurred
613            */
614            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
615                    long companyId, java.lang.String name, int scope,
616                    java.lang.String primKey, int start, int end)
617                    throws com.liferay.portal.kernel.exception.SystemException {
618                    return getPersistence()
619                                       .findByC_N_S_P(companyId, name, scope, primKey, start, end);
620            }
621    
622            /**
623            * Finds an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
624            *
625            * <p>
626            * 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.
627            * </p>
628            *
629            * @param companyId the company id to search with
630            * @param name the name to search with
631            * @param scope the scope to search with
632            * @param primKey the prim key to search with
633            * @param start the lower bound of the range of resource permissions to return
634            * @param end the upper bound of the range of resource permissions to return (not inclusive)
635            * @param orderByComparator the comparator to order the results by
636            * @return the ordered range of matching resource permissions
637            * @throws SystemException if a system exception occurred
638            */
639            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
640                    long companyId, java.lang.String name, int scope,
641                    java.lang.String primKey, int start, int end,
642                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
643                    throws com.liferay.portal.kernel.exception.SystemException {
644                    return getPersistence()
645                                       .findByC_N_S_P(companyId, name, scope, primKey, start, end,
646                            orderByComparator);
647            }
648    
649            /**
650            * Finds the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
651            *
652            * <p>
653            * 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.
654            * </p>
655            *
656            * @param companyId the company id to search with
657            * @param name the name to search with
658            * @param scope the scope to search with
659            * @param primKey the prim key to search with
660            * @param orderByComparator the comparator to order the set by
661            * @return the first matching resource permission
662            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
663            * @throws SystemException if a system exception occurred
664            */
665            public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_First(
666                    long companyId, java.lang.String name, int scope,
667                    java.lang.String primKey,
668                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
669                    throws com.liferay.portal.NoSuchResourcePermissionException,
670                            com.liferay.portal.kernel.exception.SystemException {
671                    return getPersistence()
672                                       .findByC_N_S_P_First(companyId, name, scope, primKey,
673                            orderByComparator);
674            }
675    
676            /**
677            * Finds the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
678            *
679            * <p>
680            * 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.
681            * </p>
682            *
683            * @param companyId the company id to search with
684            * @param name the name to search with
685            * @param scope the scope to search with
686            * @param primKey the prim key to search with
687            * @param orderByComparator the comparator to order the set by
688            * @return the last matching resource permission
689            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
690            * @throws SystemException if a system exception occurred
691            */
692            public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_Last(
693                    long companyId, java.lang.String name, int scope,
694                    java.lang.String primKey,
695                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
696                    throws com.liferay.portal.NoSuchResourcePermissionException,
697                            com.liferay.portal.kernel.exception.SystemException {
698                    return getPersistence()
699                                       .findByC_N_S_P_Last(companyId, name, scope, primKey,
700                            orderByComparator);
701            }
702    
703            /**
704            * Finds the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
705            *
706            * <p>
707            * 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.
708            * </p>
709            *
710            * @param resourcePermissionId the primary key of the current resource permission
711            * @param companyId the company id to search with
712            * @param name the name to search with
713            * @param scope the scope to search with
714            * @param primKey the prim key to search with
715            * @param orderByComparator the comparator to order the set by
716            * @return the previous, current, and next resource permission
717            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
718            * @throws SystemException if a system exception occurred
719            */
720            public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_P_PrevAndNext(
721                    long resourcePermissionId, long companyId, java.lang.String name,
722                    int scope, java.lang.String primKey,
723                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
724                    throws com.liferay.portal.NoSuchResourcePermissionException,
725                            com.liferay.portal.kernel.exception.SystemException {
726                    return getPersistence()
727                                       .findByC_N_S_P_PrevAndNext(resourcePermissionId, companyId,
728                            name, scope, primKey, orderByComparator);
729            }
730    
731            /**
732            * Finds the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; or throws a {@link com.liferay.portal.NoSuchResourcePermissionException} if it could not be found.
733            *
734            * @param companyId the company id to search with
735            * @param name the name to search with
736            * @param scope the scope to search with
737            * @param primKey the prim key to search with
738            * @param roleId the role id to search with
739            * @return the matching resource permission
740            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
741            * @throws SystemException if a system exception occurred
742            */
743            public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_R(
744                    long companyId, java.lang.String name, int scope,
745                    java.lang.String primKey, long roleId)
746                    throws com.liferay.portal.NoSuchResourcePermissionException,
747                            com.liferay.portal.kernel.exception.SystemException {
748                    return getPersistence()
749                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleId);
750            }
751    
752            /**
753            * Finds the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
754            *
755            * @param companyId the company id to search with
756            * @param name the name to search with
757            * @param scope the scope to search with
758            * @param primKey the prim key to search with
759            * @param roleId the role id to search with
760            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
761            * @throws SystemException if a system exception occurred
762            */
763            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
764                    long companyId, java.lang.String name, int scope,
765                    java.lang.String primKey, long roleId)
766                    throws com.liferay.portal.kernel.exception.SystemException {
767                    return getPersistence()
768                                       .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId);
769            }
770    
771            /**
772            * Finds the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
773            *
774            * @param companyId the company id to search with
775            * @param name the name to search with
776            * @param scope the scope to search with
777            * @param primKey the prim key to search with
778            * @param roleId the role id to search with
779            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
780            * @throws SystemException if a system exception occurred
781            */
782            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
783                    long companyId, java.lang.String name, int scope,
784                    java.lang.String primKey, long roleId, boolean retrieveFromCache)
785                    throws com.liferay.portal.kernel.exception.SystemException {
786                    return getPersistence()
787                                       .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId,
788                            retrieveFromCache);
789            }
790    
791            /**
792            * Finds all the resource permissions.
793            *
794            * @return the resource permissions
795            * @throws SystemException if a system exception occurred
796            */
797            public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll()
798                    throws com.liferay.portal.kernel.exception.SystemException {
799                    return getPersistence().findAll();
800            }
801    
802            /**
803            * Finds a range of all the resource permissions.
804            *
805            * <p>
806            * 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.
807            * </p>
808            *
809            * @param start the lower bound of the range of resource permissions to return
810            * @param end the upper bound of the range of resource permissions to return (not inclusive)
811            * @return the range of resource permissions
812            * @throws SystemException if a system exception occurred
813            */
814            public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
815                    int start, int end)
816                    throws com.liferay.portal.kernel.exception.SystemException {
817                    return getPersistence().findAll(start, end);
818            }
819    
820            /**
821            * Finds an ordered range of all the resource permissions.
822            *
823            * <p>
824            * 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.
825            * </p>
826            *
827            * @param start the lower bound of the range of resource permissions to return
828            * @param end the upper bound of the range of resource permissions to return (not inclusive)
829            * @param orderByComparator the comparator to order the results by
830            * @return the ordered range of resource permissions
831            * @throws SystemException if a system exception occurred
832            */
833            public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
834                    int start, int end,
835                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
836                    throws com.liferay.portal.kernel.exception.SystemException {
837                    return getPersistence().findAll(start, end, orderByComparator);
838            }
839    
840            /**
841            * Removes all the resource permissions where roleId = &#63; from the database.
842            *
843            * @param roleId the role id to search with
844            * @throws SystemException if a system exception occurred
845            */
846            public static void removeByRoleId(long roleId)
847                    throws com.liferay.portal.kernel.exception.SystemException {
848                    getPersistence().removeByRoleId(roleId);
849            }
850    
851            /**
852            * Removes all the resource permissions where roleId = &#63; and scope = &#63; from the database.
853            *
854            * @param roleId the role id to search with
855            * @param scope the scope to search with
856            * @throws SystemException if a system exception occurred
857            */
858            public static void removeByR_S(long roleId, int scope)
859                    throws com.liferay.portal.kernel.exception.SystemException {
860                    getPersistence().removeByR_S(roleId, scope);
861            }
862    
863            /**
864            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; from the database.
865            *
866            * @param companyId the company id to search with
867            * @param name the name to search with
868            * @param scope the scope to search with
869            * @throws SystemException if a system exception occurred
870            */
871            public static void removeByC_N_S(long companyId, java.lang.String name,
872                    int scope) throws com.liferay.portal.kernel.exception.SystemException {
873                    getPersistence().removeByC_N_S(companyId, name, scope);
874            }
875    
876            /**
877            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; from the database.
878            *
879            * @param companyId the company id to search with
880            * @param name the name to search with
881            * @param scope the scope to search with
882            * @param primKey the prim key to search with
883            * @throws SystemException if a system exception occurred
884            */
885            public static void removeByC_N_S_P(long companyId, java.lang.String name,
886                    int scope, java.lang.String primKey)
887                    throws com.liferay.portal.kernel.exception.SystemException {
888                    getPersistence().removeByC_N_S_P(companyId, name, scope, primKey);
889            }
890    
891            /**
892            * Removes the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; from the database.
893            *
894            * @param companyId the company id to search with
895            * @param name the name to search with
896            * @param scope the scope to search with
897            * @param primKey the prim key to search with
898            * @param roleId the role id to search with
899            * @throws SystemException if a system exception occurred
900            */
901            public static void removeByC_N_S_P_R(long companyId, java.lang.String name,
902                    int scope, java.lang.String primKey, long roleId)
903                    throws com.liferay.portal.NoSuchResourcePermissionException,
904                            com.liferay.portal.kernel.exception.SystemException {
905                    getPersistence()
906                            .removeByC_N_S_P_R(companyId, name, scope, primKey, roleId);
907            }
908    
909            /**
910            * Removes all the resource permissions from the database.
911            *
912            * @throws SystemException if a system exception occurred
913            */
914            public static void removeAll()
915                    throws com.liferay.portal.kernel.exception.SystemException {
916                    getPersistence().removeAll();
917            }
918    
919            /**
920            * Counts all the resource permissions where roleId = &#63;.
921            *
922            * @param roleId the role id to search with
923            * @return the number of matching resource permissions
924            * @throws SystemException if a system exception occurred
925            */
926            public static int countByRoleId(long roleId)
927                    throws com.liferay.portal.kernel.exception.SystemException {
928                    return getPersistence().countByRoleId(roleId);
929            }
930    
931            /**
932            * Counts all the resource permissions where roleId = &#63; and scope = &#63;.
933            *
934            * @param roleId the role id to search with
935            * @param scope the scope to search with
936            * @return the number of matching resource permissions
937            * @throws SystemException if a system exception occurred
938            */
939            public static int countByR_S(long roleId, int scope)
940                    throws com.liferay.portal.kernel.exception.SystemException {
941                    return getPersistence().countByR_S(roleId, scope);
942            }
943    
944            /**
945            * Counts all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
946            *
947            * @param companyId the company id to search with
948            * @param name the name to search with
949            * @param scope the scope to search with
950            * @return the number of matching resource permissions
951            * @throws SystemException if a system exception occurred
952            */
953            public static int countByC_N_S(long companyId, java.lang.String name,
954                    int scope) throws com.liferay.portal.kernel.exception.SystemException {
955                    return getPersistence().countByC_N_S(companyId, name, scope);
956            }
957    
958            /**
959            * Counts all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
960            *
961            * @param companyId the company id to search with
962            * @param name the name to search with
963            * @param scope the scope to search with
964            * @param primKey the prim key to search with
965            * @return the number of matching resource permissions
966            * @throws SystemException if a system exception occurred
967            */
968            public static int countByC_N_S_P(long companyId, java.lang.String name,
969                    int scope, java.lang.String primKey)
970                    throws com.liferay.portal.kernel.exception.SystemException {
971                    return getPersistence().countByC_N_S_P(companyId, name, scope, primKey);
972            }
973    
974            /**
975            * Counts all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63;.
976            *
977            * @param companyId the company id to search with
978            * @param name the name to search with
979            * @param scope the scope to search with
980            * @param primKey the prim key to search with
981            * @param roleId the role id to search with
982            * @return the number of matching resource permissions
983            * @throws SystemException if a system exception occurred
984            */
985            public static int countByC_N_S_P_R(long companyId, java.lang.String name,
986                    int scope, java.lang.String primKey, long roleId)
987                    throws com.liferay.portal.kernel.exception.SystemException {
988                    return getPersistence()
989                                       .countByC_N_S_P_R(companyId, name, scope, primKey, roleId);
990            }
991    
992            /**
993            * Counts all the resource permissions.
994            *
995            * @return the number of resource permissions
996            * @throws SystemException if a system exception occurred
997            */
998            public static int countAll()
999                    throws com.liferay.portal.kernel.exception.SystemException {
1000                    return getPersistence().countAll();
1001            }
1002    
1003            public static ResourcePermissionPersistence getPersistence() {
1004                    if (_persistence == null) {
1005                            _persistence = (ResourcePermissionPersistence)PortalBeanLocatorUtil.locate(ResourcePermissionPersistence.class.getName());
1006                    }
1007    
1008                    return _persistence;
1009            }
1010    
1011            public void setPersistence(ResourcePermissionPersistence persistence) {
1012                    _persistence = persistence;
1013            }
1014    
1015            private static ResourcePermissionPersistence _persistence;
1016    }