001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.ResourcePermission;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * 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.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ResourcePermissionPersistence
036     * @see ResourcePermissionPersistenceImpl
037     * @generated
038     */
039    public class ResourcePermissionUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(ResourcePermission resourcePermission) {
057                    getPersistence().clearCache(resourcePermission);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<ResourcePermission> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<ResourcePermission> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<ResourcePermission> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
098             */
099            public static ResourcePermission update(
100                    ResourcePermission resourcePermission) throws SystemException {
101                    return getPersistence().update(resourcePermission);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static ResourcePermission update(
108                    ResourcePermission resourcePermission, ServiceContext serviceContext)
109                    throws SystemException {
110                    return getPersistence().update(resourcePermission, serviceContext);
111            }
112    
113            /**
114            * Returns all the resource permissions where scope = &#63;.
115            *
116            * @param scope the scope
117            * @return the matching resource permissions
118            * @throws SystemException if a system exception occurred
119            */
120            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByScope(
121                    int scope) throws com.liferay.portal.kernel.exception.SystemException {
122                    return getPersistence().findByScope(scope);
123            }
124    
125            /**
126            * Returns a range of all the resource permissions where scope = &#63;.
127            *
128            * <p>
129            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
130            * </p>
131            *
132            * @param scope the scope
133            * @param start the lower bound of the range of resource permissions
134            * @param end the upper bound of the range of resource permissions (not inclusive)
135            * @return the range of matching resource permissions
136            * @throws SystemException if a system exception occurred
137            */
138            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByScope(
139                    int scope, int start, int end)
140                    throws com.liferay.portal.kernel.exception.SystemException {
141                    return getPersistence().findByScope(scope, start, end);
142            }
143    
144            /**
145            * Returns an ordered range of all the resource permissions where scope = &#63;.
146            *
147            * <p>
148            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
149            * </p>
150            *
151            * @param scope the scope
152            * @param start the lower bound of the range of resource permissions
153            * @param end the upper bound of the range of resource permissions (not inclusive)
154            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
155            * @return the ordered range of matching resource permissions
156            * @throws SystemException if a system exception occurred
157            */
158            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByScope(
159                    int scope, int start, int end,
160                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().findByScope(scope, start, end, orderByComparator);
163            }
164    
165            /**
166            * Returns the first resource permission in the ordered set where scope = &#63;.
167            *
168            * @param scope the scope
169            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
170            * @return the first matching resource permission
171            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portal.model.ResourcePermission findByScope_First(
175                    int scope,
176                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177                    throws com.liferay.portal.NoSuchResourcePermissionException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getPersistence().findByScope_First(scope, orderByComparator);
180            }
181    
182            /**
183            * Returns the first resource permission in the ordered set where scope = &#63;.
184            *
185            * @param scope the scope
186            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
187            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
188            * @throws SystemException if a system exception occurred
189            */
190            public static com.liferay.portal.model.ResourcePermission fetchByScope_First(
191                    int scope,
192                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByScope_First(scope, orderByComparator);
195            }
196    
197            /**
198            * Returns the last resource permission in the ordered set where scope = &#63;.
199            *
200            * @param scope the scope
201            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
202            * @return the last matching resource permission
203            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
204            * @throws SystemException if a system exception occurred
205            */
206            public static com.liferay.portal.model.ResourcePermission findByScope_Last(
207                    int scope,
208                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
209                    throws com.liferay.portal.NoSuchResourcePermissionException,
210                            com.liferay.portal.kernel.exception.SystemException {
211                    return getPersistence().findByScope_Last(scope, orderByComparator);
212            }
213    
214            /**
215            * Returns the last resource permission in the ordered set where scope = &#63;.
216            *
217            * @param scope the scope
218            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
219            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
220            * @throws SystemException if a system exception occurred
221            */
222            public static com.liferay.portal.model.ResourcePermission fetchByScope_Last(
223                    int scope,
224                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().fetchByScope_Last(scope, orderByComparator);
227            }
228    
229            /**
230            * Returns the resource permissions before and after the current resource permission in the ordered set where scope = &#63;.
231            *
232            * @param resourcePermissionId the primary key of the current resource permission
233            * @param scope the scope
234            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
235            * @return the previous, current, and next resource permission
236            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
237            * @throws SystemException if a system exception occurred
238            */
239            public static com.liferay.portal.model.ResourcePermission[] findByScope_PrevAndNext(
240                    long resourcePermissionId, int scope,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.NoSuchResourcePermissionException,
243                            com.liferay.portal.kernel.exception.SystemException {
244                    return getPersistence()
245                                       .findByScope_PrevAndNext(resourcePermissionId, scope,
246                            orderByComparator);
247            }
248    
249            /**
250            * Returns all the resource permissions where scope = any &#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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
254            * </p>
255            *
256            * @param scopes the scopes
257            * @return the matching resource permissions
258            * @throws SystemException if a system exception occurred
259            */
260            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByScope(
261                    int[] scopes)
262                    throws com.liferay.portal.kernel.exception.SystemException {
263                    return getPersistence().findByScope(scopes);
264            }
265    
266            /**
267            * Returns a range of all the resource permissions where scope = any &#63;.
268            *
269            * <p>
270            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
271            * </p>
272            *
273            * @param scopes the scopes
274            * @param start the lower bound of the range of resource permissions
275            * @param end the upper bound of the range of resource permissions (not inclusive)
276            * @return the range of matching resource permissions
277            * @throws SystemException if a system exception occurred
278            */
279            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByScope(
280                    int[] scopes, int start, int end)
281                    throws com.liferay.portal.kernel.exception.SystemException {
282                    return getPersistence().findByScope(scopes, start, end);
283            }
284    
285            /**
286            * Returns an ordered range of all the resource permissions where scope = any &#63;.
287            *
288            * <p>
289            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
290            * </p>
291            *
292            * @param scopes the scopes
293            * @param start the lower bound of the range of resource permissions
294            * @param end the upper bound of the range of resource permissions (not inclusive)
295            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
296            * @return the ordered range of matching resource permissions
297            * @throws SystemException if a system exception occurred
298            */
299            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByScope(
300                    int[] scopes, int start, int end,
301                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
302                    throws com.liferay.portal.kernel.exception.SystemException {
303                    return getPersistence()
304                                       .findByScope(scopes, start, end, orderByComparator);
305            }
306    
307            /**
308            * Removes all the resource permissions where scope = &#63; from the database.
309            *
310            * @param scope the scope
311            * @throws SystemException if a system exception occurred
312            */
313            public static void removeByScope(int scope)
314                    throws com.liferay.portal.kernel.exception.SystemException {
315                    getPersistence().removeByScope(scope);
316            }
317    
318            /**
319            * Returns the number of resource permissions where scope = &#63;.
320            *
321            * @param scope the scope
322            * @return the number of matching resource permissions
323            * @throws SystemException if a system exception occurred
324            */
325            public static int countByScope(int scope)
326                    throws com.liferay.portal.kernel.exception.SystemException {
327                    return getPersistence().countByScope(scope);
328            }
329    
330            /**
331            * Returns the number of resource permissions where scope = any &#63;.
332            *
333            * @param scopes the scopes
334            * @return the number of matching resource permissions
335            * @throws SystemException if a system exception occurred
336            */
337            public static int countByScope(int[] scopes)
338                    throws com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().countByScope(scopes);
340            }
341    
342            /**
343            * Returns all the resource permissions where roleId = &#63;.
344            *
345            * @param roleId the role ID
346            * @return the matching resource permissions
347            * @throws SystemException if a system exception occurred
348            */
349            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
350                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
351                    return getPersistence().findByRoleId(roleId);
352            }
353    
354            /**
355            * Returns a range of all the resource permissions where roleId = &#63;.
356            *
357            * <p>
358            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
359            * </p>
360            *
361            * @param roleId the role ID
362            * @param start the lower bound of the range of resource permissions
363            * @param end the upper bound of the range of resource permissions (not inclusive)
364            * @return the range of matching resource permissions
365            * @throws SystemException if a system exception occurred
366            */
367            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
368                    long roleId, int start, int end)
369                    throws com.liferay.portal.kernel.exception.SystemException {
370                    return getPersistence().findByRoleId(roleId, start, end);
371            }
372    
373            /**
374            * Returns an ordered range of all the resource permissions where roleId = &#63;.
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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
378            * </p>
379            *
380            * @param roleId the role ID
381            * @param start the lower bound of the range of resource permissions
382            * @param end the upper bound of the range of resource permissions (not inclusive)
383            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
384            * @return the ordered range of matching resource permissions
385            * @throws SystemException if a system exception occurred
386            */
387            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
388                    long roleId, int start, int end,
389                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
390                    throws com.liferay.portal.kernel.exception.SystemException {
391                    return getPersistence()
392                                       .findByRoleId(roleId, start, end, orderByComparator);
393            }
394    
395            /**
396            * Returns the first resource permission in the ordered set where roleId = &#63;.
397            *
398            * @param roleId the role ID
399            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
400            * @return the first matching resource permission
401            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
402            * @throws SystemException if a system exception occurred
403            */
404            public static com.liferay.portal.model.ResourcePermission findByRoleId_First(
405                    long roleId,
406                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
407                    throws com.liferay.portal.NoSuchResourcePermissionException,
408                            com.liferay.portal.kernel.exception.SystemException {
409                    return getPersistence().findByRoleId_First(roleId, orderByComparator);
410            }
411    
412            /**
413            * Returns the first resource permission in the ordered set where roleId = &#63;.
414            *
415            * @param roleId the role ID
416            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
417            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
418            * @throws SystemException if a system exception occurred
419            */
420            public static com.liferay.portal.model.ResourcePermission fetchByRoleId_First(
421                    long roleId,
422                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getPersistence().fetchByRoleId_First(roleId, orderByComparator);
425            }
426    
427            /**
428            * Returns the last resource permission in the ordered set where roleId = &#63;.
429            *
430            * @param roleId the role ID
431            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
432            * @return the last matching resource permission
433            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
434            * @throws SystemException if a system exception occurred
435            */
436            public static com.liferay.portal.model.ResourcePermission findByRoleId_Last(
437                    long roleId,
438                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
439                    throws com.liferay.portal.NoSuchResourcePermissionException,
440                            com.liferay.portal.kernel.exception.SystemException {
441                    return getPersistence().findByRoleId_Last(roleId, orderByComparator);
442            }
443    
444            /**
445            * Returns the last resource permission in the ordered set where roleId = &#63;.
446            *
447            * @param roleId the role ID
448            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
449            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
450            * @throws SystemException if a system exception occurred
451            */
452            public static com.liferay.portal.model.ResourcePermission fetchByRoleId_Last(
453                    long roleId,
454                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
455                    throws com.liferay.portal.kernel.exception.SystemException {
456                    return getPersistence().fetchByRoleId_Last(roleId, orderByComparator);
457            }
458    
459            /**
460            * Returns the resource permissions before and after the current resource permission in the ordered set where roleId = &#63;.
461            *
462            * @param resourcePermissionId the primary key of the current resource permission
463            * @param roleId the role ID
464            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
465            * @return the previous, current, and next resource permission
466            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
467            * @throws SystemException if a system exception occurred
468            */
469            public static com.liferay.portal.model.ResourcePermission[] findByRoleId_PrevAndNext(
470                    long resourcePermissionId, long roleId,
471                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
472                    throws com.liferay.portal.NoSuchResourcePermissionException,
473                            com.liferay.portal.kernel.exception.SystemException {
474                    return getPersistence()
475                                       .findByRoleId_PrevAndNext(resourcePermissionId, roleId,
476                            orderByComparator);
477            }
478    
479            /**
480            * Removes all the resource permissions where roleId = &#63; from the database.
481            *
482            * @param roleId the role ID
483            * @throws SystemException if a system exception occurred
484            */
485            public static void removeByRoleId(long roleId)
486                    throws com.liferay.portal.kernel.exception.SystemException {
487                    getPersistence().removeByRoleId(roleId);
488            }
489    
490            /**
491            * Returns the number of resource permissions where roleId = &#63;.
492            *
493            * @param roleId the role ID
494            * @return the number of matching resource permissions
495            * @throws SystemException if a system exception occurred
496            */
497            public static int countByRoleId(long roleId)
498                    throws com.liferay.portal.kernel.exception.SystemException {
499                    return getPersistence().countByRoleId(roleId);
500            }
501    
502            /**
503            * Returns all the resource permissions where companyId = &#63; and primKey LIKE &#63;.
504            *
505            * @param companyId the company ID
506            * @param primKey the prim key
507            * @return the matching resource permissions
508            * @throws SystemException if a system exception occurred
509            */
510            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_LikeP(
511                    long companyId, java.lang.String primKey)
512                    throws com.liferay.portal.kernel.exception.SystemException {
513                    return getPersistence().findByC_LikeP(companyId, primKey);
514            }
515    
516            /**
517            * Returns a range of all the resource permissions where companyId = &#63; and primKey LIKE &#63;.
518            *
519            * <p>
520            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
521            * </p>
522            *
523            * @param companyId the company ID
524            * @param primKey the prim key
525            * @param start the lower bound of the range of resource permissions
526            * @param end the upper bound of the range of resource permissions (not inclusive)
527            * @return the range of matching resource permissions
528            * @throws SystemException if a system exception occurred
529            */
530            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_LikeP(
531                    long companyId, java.lang.String primKey, int start, int end)
532                    throws com.liferay.portal.kernel.exception.SystemException {
533                    return getPersistence().findByC_LikeP(companyId, primKey, start, end);
534            }
535    
536            /**
537            * Returns an ordered range of all the resource permissions where companyId = &#63; and primKey LIKE &#63;.
538            *
539            * <p>
540            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
541            * </p>
542            *
543            * @param companyId the company ID
544            * @param primKey the prim key
545            * @param start the lower bound of the range of resource permissions
546            * @param end the upper bound of the range of resource permissions (not inclusive)
547            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
548            * @return the ordered range of matching resource permissions
549            * @throws SystemException if a system exception occurred
550            */
551            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_LikeP(
552                    long companyId, java.lang.String primKey, int start, int end,
553                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
554                    throws com.liferay.portal.kernel.exception.SystemException {
555                    return getPersistence()
556                                       .findByC_LikeP(companyId, primKey, start, end,
557                            orderByComparator);
558            }
559    
560            /**
561            * Returns the first resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
562            *
563            * @param companyId the company ID
564            * @param primKey the prim key
565            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
566            * @return the first matching resource permission
567            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
568            * @throws SystemException if a system exception occurred
569            */
570            public static com.liferay.portal.model.ResourcePermission findByC_LikeP_First(
571                    long companyId, java.lang.String primKey,
572                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
573                    throws com.liferay.portal.NoSuchResourcePermissionException,
574                            com.liferay.portal.kernel.exception.SystemException {
575                    return getPersistence()
576                                       .findByC_LikeP_First(companyId, primKey, orderByComparator);
577            }
578    
579            /**
580            * Returns the first resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
581            *
582            * @param companyId the company ID
583            * @param primKey the prim key
584            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
585            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
586            * @throws SystemException if a system exception occurred
587            */
588            public static com.liferay.portal.model.ResourcePermission fetchByC_LikeP_First(
589                    long companyId, java.lang.String primKey,
590                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
591                    throws com.liferay.portal.kernel.exception.SystemException {
592                    return getPersistence()
593                                       .fetchByC_LikeP_First(companyId, primKey, orderByComparator);
594            }
595    
596            /**
597            * Returns the last resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
598            *
599            * @param companyId the company ID
600            * @param primKey the prim key
601            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
602            * @return the last matching resource permission
603            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
604            * @throws SystemException if a system exception occurred
605            */
606            public static com.liferay.portal.model.ResourcePermission findByC_LikeP_Last(
607                    long companyId, java.lang.String primKey,
608                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
609                    throws com.liferay.portal.NoSuchResourcePermissionException,
610                            com.liferay.portal.kernel.exception.SystemException {
611                    return getPersistence()
612                                       .findByC_LikeP_Last(companyId, primKey, orderByComparator);
613            }
614    
615            /**
616            * Returns the last resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
617            *
618            * @param companyId the company ID
619            * @param primKey the prim key
620            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
621            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
622            * @throws SystemException if a system exception occurred
623            */
624            public static com.liferay.portal.model.ResourcePermission fetchByC_LikeP_Last(
625                    long companyId, java.lang.String primKey,
626                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
627                    throws com.liferay.portal.kernel.exception.SystemException {
628                    return getPersistence()
629                                       .fetchByC_LikeP_Last(companyId, primKey, orderByComparator);
630            }
631    
632            /**
633            * Returns the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
634            *
635            * @param resourcePermissionId the primary key of the current resource permission
636            * @param companyId the company ID
637            * @param primKey the prim key
638            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
639            * @return the previous, current, and next resource permission
640            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
641            * @throws SystemException if a system exception occurred
642            */
643            public static com.liferay.portal.model.ResourcePermission[] findByC_LikeP_PrevAndNext(
644                    long resourcePermissionId, long companyId, java.lang.String primKey,
645                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
646                    throws com.liferay.portal.NoSuchResourcePermissionException,
647                            com.liferay.portal.kernel.exception.SystemException {
648                    return getPersistence()
649                                       .findByC_LikeP_PrevAndNext(resourcePermissionId, companyId,
650                            primKey, orderByComparator);
651            }
652    
653            /**
654            * Removes all the resource permissions where companyId = &#63; and primKey LIKE &#63; from the database.
655            *
656            * @param companyId the company ID
657            * @param primKey the prim key
658            * @throws SystemException if a system exception occurred
659            */
660            public static void removeByC_LikeP(long companyId, java.lang.String primKey)
661                    throws com.liferay.portal.kernel.exception.SystemException {
662                    getPersistence().removeByC_LikeP(companyId, primKey);
663            }
664    
665            /**
666            * Returns the number of resource permissions where companyId = &#63; and primKey LIKE &#63;.
667            *
668            * @param companyId the company ID
669            * @param primKey the prim key
670            * @return the number of matching resource permissions
671            * @throws SystemException if a system exception occurred
672            */
673            public static int countByC_LikeP(long companyId, java.lang.String primKey)
674                    throws com.liferay.portal.kernel.exception.SystemException {
675                    return getPersistence().countByC_LikeP(companyId, primKey);
676            }
677    
678            /**
679            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
680            *
681            * @param companyId the company ID
682            * @param name the name
683            * @param scope the scope
684            * @return the matching resource permissions
685            * @throws SystemException if a system exception occurred
686            */
687            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
688                    long companyId, java.lang.String name, int scope)
689                    throws com.liferay.portal.kernel.exception.SystemException {
690                    return getPersistence().findByC_N_S(companyId, name, scope);
691            }
692    
693            /**
694            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
695            *
696            * <p>
697            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
698            * </p>
699            *
700            * @param companyId the company ID
701            * @param name the name
702            * @param scope the scope
703            * @param start the lower bound of the range of resource permissions
704            * @param end the upper bound of the range of resource permissions (not inclusive)
705            * @return the range of matching resource permissions
706            * @throws SystemException if a system exception occurred
707            */
708            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
709                    long companyId, java.lang.String name, int scope, int start, int end)
710                    throws com.liferay.portal.kernel.exception.SystemException {
711                    return getPersistence().findByC_N_S(companyId, name, scope, start, end);
712            }
713    
714            /**
715            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
716            *
717            * <p>
718            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
719            * </p>
720            *
721            * @param companyId the company ID
722            * @param name the name
723            * @param scope the scope
724            * @param start the lower bound of the range of resource permissions
725            * @param end the upper bound of the range of resource permissions (not inclusive)
726            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
727            * @return the ordered range of matching resource permissions
728            * @throws SystemException if a system exception occurred
729            */
730            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
731                    long companyId, java.lang.String name, int scope, int start, int end,
732                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
733                    throws com.liferay.portal.kernel.exception.SystemException {
734                    return getPersistence()
735                                       .findByC_N_S(companyId, name, scope, start, end,
736                            orderByComparator);
737            }
738    
739            /**
740            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
741            *
742            * @param companyId the company ID
743            * @param name the name
744            * @param scope the scope
745            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
746            * @return the first matching resource permission
747            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
748            * @throws SystemException if a system exception occurred
749            */
750            public static com.liferay.portal.model.ResourcePermission findByC_N_S_First(
751                    long companyId, java.lang.String name, int scope,
752                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
753                    throws com.liferay.portal.NoSuchResourcePermissionException,
754                            com.liferay.portal.kernel.exception.SystemException {
755                    return getPersistence()
756                                       .findByC_N_S_First(companyId, name, scope, orderByComparator);
757            }
758    
759            /**
760            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
761            *
762            * @param companyId the company ID
763            * @param name the name
764            * @param scope the scope
765            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
766            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
767            * @throws SystemException if a system exception occurred
768            */
769            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_First(
770                    long companyId, java.lang.String name, int scope,
771                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
772                    throws com.liferay.portal.kernel.exception.SystemException {
773                    return getPersistence()
774                                       .fetchByC_N_S_First(companyId, name, scope, orderByComparator);
775            }
776    
777            /**
778            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
779            *
780            * @param companyId the company ID
781            * @param name the name
782            * @param scope the scope
783            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
784            * @return the last matching resource permission
785            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
786            * @throws SystemException if a system exception occurred
787            */
788            public static com.liferay.portal.model.ResourcePermission findByC_N_S_Last(
789                    long companyId, java.lang.String name, int scope,
790                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
791                    throws com.liferay.portal.NoSuchResourcePermissionException,
792                            com.liferay.portal.kernel.exception.SystemException {
793                    return getPersistence()
794                                       .findByC_N_S_Last(companyId, name, scope, orderByComparator);
795            }
796    
797            /**
798            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
799            *
800            * @param companyId the company ID
801            * @param name the name
802            * @param scope the scope
803            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
804            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
805            * @throws SystemException if a system exception occurred
806            */
807            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_Last(
808                    long companyId, java.lang.String name, int scope,
809                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
810                    throws com.liferay.portal.kernel.exception.SystemException {
811                    return getPersistence()
812                                       .fetchByC_N_S_Last(companyId, name, scope, orderByComparator);
813            }
814    
815            /**
816            * Returns the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
817            *
818            * @param resourcePermissionId the primary key of the current resource permission
819            * @param companyId the company ID
820            * @param name the name
821            * @param scope the scope
822            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
823            * @return the previous, current, and next resource permission
824            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
825            * @throws SystemException if a system exception occurred
826            */
827            public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_PrevAndNext(
828                    long resourcePermissionId, long companyId, java.lang.String name,
829                    int scope,
830                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
831                    throws com.liferay.portal.NoSuchResourcePermissionException,
832                            com.liferay.portal.kernel.exception.SystemException {
833                    return getPersistence()
834                                       .findByC_N_S_PrevAndNext(resourcePermissionId, companyId,
835                            name, scope, orderByComparator);
836            }
837    
838            /**
839            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; from the database.
840            *
841            * @param companyId the company ID
842            * @param name the name
843            * @param scope the scope
844            * @throws SystemException if a system exception occurred
845            */
846            public static void removeByC_N_S(long companyId, java.lang.String name,
847                    int scope) throws com.liferay.portal.kernel.exception.SystemException {
848                    getPersistence().removeByC_N_S(companyId, name, scope);
849            }
850    
851            /**
852            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
853            *
854            * @param companyId the company ID
855            * @param name the name
856            * @param scope the scope
857            * @return the number of matching resource permissions
858            * @throws SystemException if a system exception occurred
859            */
860            public static int countByC_N_S(long companyId, java.lang.String name,
861                    int scope) throws com.liferay.portal.kernel.exception.SystemException {
862                    return getPersistence().countByC_N_S(companyId, name, scope);
863            }
864    
865            /**
866            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
867            *
868            * @param companyId the company ID
869            * @param name the name
870            * @param scope the scope
871            * @param primKey the prim key
872            * @return the matching resource permissions
873            * @throws SystemException if a system exception occurred
874            */
875            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
876                    long companyId, java.lang.String name, int scope,
877                    java.lang.String primKey)
878                    throws com.liferay.portal.kernel.exception.SystemException {
879                    return getPersistence().findByC_N_S_P(companyId, name, scope, primKey);
880            }
881    
882            /**
883            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
884            *
885            * <p>
886            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
887            * </p>
888            *
889            * @param companyId the company ID
890            * @param name the name
891            * @param scope the scope
892            * @param primKey the prim key
893            * @param start the lower bound of the range of resource permissions
894            * @param end the upper bound of the range of resource permissions (not inclusive)
895            * @return the range of matching resource permissions
896            * @throws SystemException if a system exception occurred
897            */
898            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
899                    long companyId, java.lang.String name, int scope,
900                    java.lang.String primKey, int start, int end)
901                    throws com.liferay.portal.kernel.exception.SystemException {
902                    return getPersistence()
903                                       .findByC_N_S_P(companyId, name, scope, primKey, start, end);
904            }
905    
906            /**
907            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
908            *
909            * <p>
910            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
911            * </p>
912            *
913            * @param companyId the company ID
914            * @param name the name
915            * @param scope the scope
916            * @param primKey the prim key
917            * @param start the lower bound of the range of resource permissions
918            * @param end the upper bound of the range of resource permissions (not inclusive)
919            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
920            * @return the ordered range of matching resource permissions
921            * @throws SystemException if a system exception occurred
922            */
923            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
924                    long companyId, java.lang.String name, int scope,
925                    java.lang.String primKey, int start, int end,
926                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
927                    throws com.liferay.portal.kernel.exception.SystemException {
928                    return getPersistence()
929                                       .findByC_N_S_P(companyId, name, scope, primKey, start, end,
930                            orderByComparator);
931            }
932    
933            /**
934            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
935            *
936            * @param companyId the company ID
937            * @param name the name
938            * @param scope the scope
939            * @param primKey the prim key
940            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
941            * @return the first matching resource permission
942            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
943            * @throws SystemException if a system exception occurred
944            */
945            public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_First(
946                    long companyId, java.lang.String name, int scope,
947                    java.lang.String primKey,
948                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
949                    throws com.liferay.portal.NoSuchResourcePermissionException,
950                            com.liferay.portal.kernel.exception.SystemException {
951                    return getPersistence()
952                                       .findByC_N_S_P_First(companyId, name, scope, primKey,
953                            orderByComparator);
954            }
955    
956            /**
957            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
958            *
959            * @param companyId the company ID
960            * @param name the name
961            * @param scope the scope
962            * @param primKey the prim key
963            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
964            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
965            * @throws SystemException if a system exception occurred
966            */
967            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_First(
968                    long companyId, java.lang.String name, int scope,
969                    java.lang.String primKey,
970                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
971                    throws com.liferay.portal.kernel.exception.SystemException {
972                    return getPersistence()
973                                       .fetchByC_N_S_P_First(companyId, name, scope, primKey,
974                            orderByComparator);
975            }
976    
977            /**
978            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
979            *
980            * @param companyId the company ID
981            * @param name the name
982            * @param scope the scope
983            * @param primKey the prim key
984            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
985            * @return the last matching resource permission
986            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
987            * @throws SystemException if a system exception occurred
988            */
989            public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_Last(
990                    long companyId, java.lang.String name, int scope,
991                    java.lang.String primKey,
992                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
993                    throws com.liferay.portal.NoSuchResourcePermissionException,
994                            com.liferay.portal.kernel.exception.SystemException {
995                    return getPersistence()
996                                       .findByC_N_S_P_Last(companyId, name, scope, primKey,
997                            orderByComparator);
998            }
999    
1000            /**
1001            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1002            *
1003            * @param companyId the company ID
1004            * @param name the name
1005            * @param scope the scope
1006            * @param primKey the prim key
1007            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1008            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
1009            * @throws SystemException if a system exception occurred
1010            */
1011            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_Last(
1012                    long companyId, java.lang.String name, int scope,
1013                    java.lang.String primKey,
1014                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1015                    throws com.liferay.portal.kernel.exception.SystemException {
1016                    return getPersistence()
1017                                       .fetchByC_N_S_P_Last(companyId, name, scope, primKey,
1018                            orderByComparator);
1019            }
1020    
1021            /**
1022            * Returns 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;.
1023            *
1024            * @param resourcePermissionId the primary key of the current resource permission
1025            * @param companyId the company ID
1026            * @param name the name
1027            * @param scope the scope
1028            * @param primKey the prim key
1029            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1030            * @return the previous, current, and next resource permission
1031            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
1032            * @throws SystemException if a system exception occurred
1033            */
1034            public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_P_PrevAndNext(
1035                    long resourcePermissionId, long companyId, java.lang.String name,
1036                    int scope, java.lang.String primKey,
1037                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1038                    throws com.liferay.portal.NoSuchResourcePermissionException,
1039                            com.liferay.portal.kernel.exception.SystemException {
1040                    return getPersistence()
1041                                       .findByC_N_S_P_PrevAndNext(resourcePermissionId, companyId,
1042                            name, scope, primKey, orderByComparator);
1043            }
1044    
1045            /**
1046            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; from the database.
1047            *
1048            * @param companyId the company ID
1049            * @param name the name
1050            * @param scope the scope
1051            * @param primKey the prim key
1052            * @throws SystemException if a system exception occurred
1053            */
1054            public static void removeByC_N_S_P(long companyId, java.lang.String name,
1055                    int scope, java.lang.String primKey)
1056                    throws com.liferay.portal.kernel.exception.SystemException {
1057                    getPersistence().removeByC_N_S_P(companyId, name, scope, primKey);
1058            }
1059    
1060            /**
1061            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1062            *
1063            * @param companyId the company ID
1064            * @param name the name
1065            * @param scope the scope
1066            * @param primKey the prim key
1067            * @return the number of matching resource permissions
1068            * @throws SystemException if a system exception occurred
1069            */
1070            public static int countByC_N_S_P(long companyId, java.lang.String name,
1071                    int scope, java.lang.String primKey)
1072                    throws com.liferay.portal.kernel.exception.SystemException {
1073                    return getPersistence().countByC_N_S_P(companyId, name, scope, primKey);
1074            }
1075    
1076            /**
1077            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = any &#63;.
1078            *
1079            * <p>
1080            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
1081            * </p>
1082            *
1083            * @param companyId the company ID
1084            * @param name the name
1085            * @param scope the scope
1086            * @param primKey the prim key
1087            * @param roleIds the role IDs
1088            * @return the matching resource permissions
1089            * @throws SystemException if a system exception occurred
1090            */
1091            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P_R(
1092                    long companyId, java.lang.String name, int scope,
1093                    java.lang.String primKey, long[] roleIds)
1094                    throws com.liferay.portal.kernel.exception.SystemException {
1095                    return getPersistence()
1096                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleIds);
1097            }
1098    
1099            /**
1100            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = any &#63;.
1101            *
1102            * <p>
1103            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
1104            * </p>
1105            *
1106            * @param companyId the company ID
1107            * @param name the name
1108            * @param scope the scope
1109            * @param primKey the prim key
1110            * @param roleIds the role IDs
1111            * @param start the lower bound of the range of resource permissions
1112            * @param end the upper bound of the range of resource permissions (not inclusive)
1113            * @return the range of matching resource permissions
1114            * @throws SystemException if a system exception occurred
1115            */
1116            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P_R(
1117                    long companyId, java.lang.String name, int scope,
1118                    java.lang.String primKey, long[] roleIds, int start, int end)
1119                    throws com.liferay.portal.kernel.exception.SystemException {
1120                    return getPersistence()
1121                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleIds,
1122                            start, end);
1123            }
1124    
1125            /**
1126            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = any &#63;.
1127            *
1128            * <p>
1129            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
1130            * </p>
1131            *
1132            * @param companyId the company ID
1133            * @param name the name
1134            * @param scope the scope
1135            * @param primKey the prim key
1136            * @param roleIds the role IDs
1137            * @param start the lower bound of the range of resource permissions
1138            * @param end the upper bound of the range of resource permissions (not inclusive)
1139            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1140            * @return the ordered range of matching resource permissions
1141            * @throws SystemException if a system exception occurred
1142            */
1143            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P_R(
1144                    long companyId, java.lang.String name, int scope,
1145                    java.lang.String primKey, long[] roleIds, int start, int end,
1146                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1147                    throws com.liferay.portal.kernel.exception.SystemException {
1148                    return getPersistence()
1149                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleIds,
1150                            start, end, orderByComparator);
1151            }
1152    
1153            /**
1154            * Returns 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.
1155            *
1156            * @param companyId the company ID
1157            * @param name the name
1158            * @param scope the scope
1159            * @param primKey the prim key
1160            * @param roleId the role ID
1161            * @return the matching resource permission
1162            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
1163            * @throws SystemException if a system exception occurred
1164            */
1165            public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_R(
1166                    long companyId, java.lang.String name, int scope,
1167                    java.lang.String primKey, long roleId)
1168                    throws com.liferay.portal.NoSuchResourcePermissionException,
1169                            com.liferay.portal.kernel.exception.SystemException {
1170                    return getPersistence()
1171                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1172            }
1173    
1174            /**
1175            * Returns 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.
1176            *
1177            * @param companyId the company ID
1178            * @param name the name
1179            * @param scope the scope
1180            * @param primKey the prim key
1181            * @param roleId the role ID
1182            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
1183            * @throws SystemException if a system exception occurred
1184            */
1185            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
1186                    long companyId, java.lang.String name, int scope,
1187                    java.lang.String primKey, long roleId)
1188                    throws com.liferay.portal.kernel.exception.SystemException {
1189                    return getPersistence()
1190                                       .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1191            }
1192    
1193            /**
1194            * Returns 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.
1195            *
1196            * @param companyId the company ID
1197            * @param name the name
1198            * @param scope the scope
1199            * @param primKey the prim key
1200            * @param roleId the role ID
1201            * @param retrieveFromCache whether to use the finder cache
1202            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
1203            * @throws SystemException if a system exception occurred
1204            */
1205            public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
1206                    long companyId, java.lang.String name, int scope,
1207                    java.lang.String primKey, long roleId, boolean retrieveFromCache)
1208                    throws com.liferay.portal.kernel.exception.SystemException {
1209                    return getPersistence()
1210                                       .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId,
1211                            retrieveFromCache);
1212            }
1213    
1214            /**
1215            * Removes the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; from the database.
1216            *
1217            * @param companyId the company ID
1218            * @param name the name
1219            * @param scope the scope
1220            * @param primKey the prim key
1221            * @param roleId the role ID
1222            * @return the resource permission that was removed
1223            * @throws SystemException if a system exception occurred
1224            */
1225            public static com.liferay.portal.model.ResourcePermission removeByC_N_S_P_R(
1226                    long companyId, java.lang.String name, int scope,
1227                    java.lang.String primKey, long roleId)
1228                    throws com.liferay.portal.NoSuchResourcePermissionException,
1229                            com.liferay.portal.kernel.exception.SystemException {
1230                    return getPersistence()
1231                                       .removeByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1232            }
1233    
1234            /**
1235            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63;.
1236            *
1237            * @param companyId the company ID
1238            * @param name the name
1239            * @param scope the scope
1240            * @param primKey the prim key
1241            * @param roleId the role ID
1242            * @return the number of matching resource permissions
1243            * @throws SystemException if a system exception occurred
1244            */
1245            public static int countByC_N_S_P_R(long companyId, java.lang.String name,
1246                    int scope, java.lang.String primKey, long roleId)
1247                    throws com.liferay.portal.kernel.exception.SystemException {
1248                    return getPersistence()
1249                                       .countByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1250            }
1251    
1252            /**
1253            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = any &#63;.
1254            *
1255            * @param companyId the company ID
1256            * @param name the name
1257            * @param scope the scope
1258            * @param primKey the prim key
1259            * @param roleIds the role IDs
1260            * @return the number of matching resource permissions
1261            * @throws SystemException if a system exception occurred
1262            */
1263            public static int countByC_N_S_P_R(long companyId, java.lang.String name,
1264                    int scope, java.lang.String primKey, long[] roleIds)
1265                    throws com.liferay.portal.kernel.exception.SystemException {
1266                    return getPersistence()
1267                                       .countByC_N_S_P_R(companyId, name, scope, primKey, roleIds);
1268            }
1269    
1270            /**
1271            * Caches the resource permission in the entity cache if it is enabled.
1272            *
1273            * @param resourcePermission the resource permission
1274            */
1275            public static void cacheResult(
1276                    com.liferay.portal.model.ResourcePermission resourcePermission) {
1277                    getPersistence().cacheResult(resourcePermission);
1278            }
1279    
1280            /**
1281            * Caches the resource permissions in the entity cache if it is enabled.
1282            *
1283            * @param resourcePermissions the resource permissions
1284            */
1285            public static void cacheResult(
1286                    java.util.List<com.liferay.portal.model.ResourcePermission> resourcePermissions) {
1287                    getPersistence().cacheResult(resourcePermissions);
1288            }
1289    
1290            /**
1291            * Creates a new resource permission with the primary key. Does not add the resource permission to the database.
1292            *
1293            * @param resourcePermissionId the primary key for the new resource permission
1294            * @return the new resource permission
1295            */
1296            public static com.liferay.portal.model.ResourcePermission create(
1297                    long resourcePermissionId) {
1298                    return getPersistence().create(resourcePermissionId);
1299            }
1300    
1301            /**
1302            * Removes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.
1303            *
1304            * @param resourcePermissionId the primary key of the resource permission
1305            * @return the resource permission that was removed
1306            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
1307            * @throws SystemException if a system exception occurred
1308            */
1309            public static com.liferay.portal.model.ResourcePermission remove(
1310                    long resourcePermissionId)
1311                    throws com.liferay.portal.NoSuchResourcePermissionException,
1312                            com.liferay.portal.kernel.exception.SystemException {
1313                    return getPersistence().remove(resourcePermissionId);
1314            }
1315    
1316            public static com.liferay.portal.model.ResourcePermission updateImpl(
1317                    com.liferay.portal.model.ResourcePermission resourcePermission)
1318                    throws com.liferay.portal.kernel.exception.SystemException {
1319                    return getPersistence().updateImpl(resourcePermission);
1320            }
1321    
1322            /**
1323            * Returns the resource permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourcePermissionException} if it could not be found.
1324            *
1325            * @param resourcePermissionId the primary key of the resource permission
1326            * @return the resource permission
1327            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
1328            * @throws SystemException if a system exception occurred
1329            */
1330            public static com.liferay.portal.model.ResourcePermission findByPrimaryKey(
1331                    long resourcePermissionId)
1332                    throws com.liferay.portal.NoSuchResourcePermissionException,
1333                            com.liferay.portal.kernel.exception.SystemException {
1334                    return getPersistence().findByPrimaryKey(resourcePermissionId);
1335            }
1336    
1337            /**
1338            * Returns the resource permission with the primary key or returns <code>null</code> if it could not be found.
1339            *
1340            * @param resourcePermissionId the primary key of the resource permission
1341            * @return the resource permission, or <code>null</code> if a resource permission with the primary key could not be found
1342            * @throws SystemException if a system exception occurred
1343            */
1344            public static com.liferay.portal.model.ResourcePermission fetchByPrimaryKey(
1345                    long resourcePermissionId)
1346                    throws com.liferay.portal.kernel.exception.SystemException {
1347                    return getPersistence().fetchByPrimaryKey(resourcePermissionId);
1348            }
1349    
1350            /**
1351            * Returns all the resource permissions.
1352            *
1353            * @return the resource permissions
1354            * @throws SystemException if a system exception occurred
1355            */
1356            public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll()
1357                    throws com.liferay.portal.kernel.exception.SystemException {
1358                    return getPersistence().findAll();
1359            }
1360    
1361            /**
1362            * Returns a range of all the resource permissions.
1363            *
1364            * <p>
1365            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
1366            * </p>
1367            *
1368            * @param start the lower bound of the range of resource permissions
1369            * @param end the upper bound of the range of resource permissions (not inclusive)
1370            * @return the range of resource permissions
1371            * @throws SystemException if a system exception occurred
1372            */
1373            public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
1374                    int start, int end)
1375                    throws com.liferay.portal.kernel.exception.SystemException {
1376                    return getPersistence().findAll(start, end);
1377            }
1378    
1379            /**
1380            * Returns an ordered range of all the resource permissions.
1381            *
1382            * <p>
1383            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
1384            * </p>
1385            *
1386            * @param start the lower bound of the range of resource permissions
1387            * @param end the upper bound of the range of resource permissions (not inclusive)
1388            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1389            * @return the ordered range of resource permissions
1390            * @throws SystemException if a system exception occurred
1391            */
1392            public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
1393                    int start, int end,
1394                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1395                    throws com.liferay.portal.kernel.exception.SystemException {
1396                    return getPersistence().findAll(start, end, orderByComparator);
1397            }
1398    
1399            /**
1400            * Removes all the resource permissions from the database.
1401            *
1402            * @throws SystemException if a system exception occurred
1403            */
1404            public static void removeAll()
1405                    throws com.liferay.portal.kernel.exception.SystemException {
1406                    getPersistence().removeAll();
1407            }
1408    
1409            /**
1410            * Returns the number of resource permissions.
1411            *
1412            * @return the number of resource permissions
1413            * @throws SystemException if a system exception occurred
1414            */
1415            public static int countAll()
1416                    throws com.liferay.portal.kernel.exception.SystemException {
1417                    return getPersistence().countAll();
1418            }
1419    
1420            public static ResourcePermissionPersistence getPersistence() {
1421                    if (_persistence == null) {
1422                            _persistence = (ResourcePermissionPersistence)PortalBeanLocatorUtil.locate(ResourcePermissionPersistence.class.getName());
1423    
1424                            ReferenceRegistry.registerReference(ResourcePermissionUtil.class,
1425                                    "_persistence");
1426                    }
1427    
1428                    return _persistence;
1429            }
1430    
1431            /**
1432             * @deprecated As of 6.2.0
1433             */
1434            public void setPersistence(ResourcePermissionPersistence persistence) {
1435            }
1436    
1437            private static ResourcePermissionPersistence _persistence;
1438    }