001    /**
002     * Copyright (c) 2000-present 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.kernel.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.model.ResourcePermission;
022    import com.liferay.portal.kernel.service.ServiceContext;
023    import com.liferay.portal.kernel.util.OrderByComparator;
024    import com.liferay.portal.kernel.util.ReferenceRegistry;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the resource permission service. This utility wraps {@link com.liferay.portal.service.persistence.impl.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.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see ResourcePermissionPersistence
037     * @see com.liferay.portal.service.persistence.impl.ResourcePermissionPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class ResourcePermissionUtil {
042            /*
043             * NOTE FOR DEVELOPERS:
044             *
045             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
046             */
047    
048            /**
049             * @see BasePersistence#clearCache()
050             */
051            public static void clearCache() {
052                    getPersistence().clearCache();
053            }
054    
055            /**
056             * @see BasePersistence#clearCache(com.liferay.portal.kernel.model.BaseModel)
057             */
058            public static void clearCache(ResourcePermission resourcePermission) {
059                    getPersistence().clearCache(resourcePermission);
060            }
061    
062            /**
063             * @see BasePersistence#countWithDynamicQuery(DynamicQuery)
064             */
065            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<ResourcePermission> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<ResourcePermission> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end) {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<ResourcePermission> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator<ResourcePermission> orderByComparator) {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see BasePersistence#update(com.liferay.portal.kernel.model.BaseModel)
098             */
099            public static ResourcePermission update(
100                    ResourcePermission resourcePermission) {
101                    return getPersistence().update(resourcePermission);
102            }
103    
104            /**
105             * @see BasePersistence#update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
106             */
107            public static ResourcePermission update(
108                    ResourcePermission resourcePermission, ServiceContext serviceContext) {
109                    return getPersistence().update(resourcePermission, serviceContext);
110            }
111    
112            /**
113            * Returns all the resource permissions where name = &#63;.
114            *
115            * @param name the name
116            * @return the matching resource permissions
117            */
118            public static List<ResourcePermission> findByName(java.lang.String name) {
119                    return getPersistence().findByName(name);
120            }
121    
122            /**
123            * Returns a range of all the resource permissions where name = &#63;.
124            *
125            * <p>
126            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
127            * </p>
128            *
129            * @param name the name
130            * @param start the lower bound of the range of resource permissions
131            * @param end the upper bound of the range of resource permissions (not inclusive)
132            * @return the range of matching resource permissions
133            */
134            public static List<ResourcePermission> findByName(java.lang.String name,
135                    int start, int end) {
136                    return getPersistence().findByName(name, start, end);
137            }
138    
139            /**
140            * Returns an ordered range of all the resource permissions where name = &#63;.
141            *
142            * <p>
143            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
144            * </p>
145            *
146            * @param name the name
147            * @param start the lower bound of the range of resource permissions
148            * @param end the upper bound of the range of resource permissions (not inclusive)
149            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
150            * @return the ordered range of matching resource permissions
151            */
152            public static List<ResourcePermission> findByName(java.lang.String name,
153                    int start, int end,
154                    OrderByComparator<ResourcePermission> orderByComparator) {
155                    return getPersistence().findByName(name, start, end, orderByComparator);
156            }
157    
158            /**
159            * Returns an ordered range of all the resource permissions where name = &#63;.
160            *
161            * <p>
162            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
163            * </p>
164            *
165            * @param name the name
166            * @param start the lower bound of the range of resource permissions
167            * @param end the upper bound of the range of resource permissions (not inclusive)
168            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
169            * @param retrieveFromCache whether to retrieve from the finder cache
170            * @return the ordered range of matching resource permissions
171            */
172            public static List<ResourcePermission> findByName(java.lang.String name,
173                    int start, int end,
174                    OrderByComparator<ResourcePermission> orderByComparator,
175                    boolean retrieveFromCache) {
176                    return getPersistence()
177                                       .findByName(name, start, end, orderByComparator,
178                            retrieveFromCache);
179            }
180    
181            /**
182            * Returns the first resource permission in the ordered set where name = &#63;.
183            *
184            * @param name the name
185            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
186            * @return the first matching resource permission
187            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
188            */
189            public static ResourcePermission findByName_First(java.lang.String name,
190                    OrderByComparator<ResourcePermission> orderByComparator)
191                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
192                    return getPersistence().findByName_First(name, orderByComparator);
193            }
194    
195            /**
196            * Returns the first resource permission in the ordered set where name = &#63;.
197            *
198            * @param name the name
199            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
200            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
201            */
202            public static ResourcePermission fetchByName_First(java.lang.String name,
203                    OrderByComparator<ResourcePermission> orderByComparator) {
204                    return getPersistence().fetchByName_First(name, orderByComparator);
205            }
206    
207            /**
208            * Returns the last resource permission in the ordered set where name = &#63;.
209            *
210            * @param name the name
211            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
212            * @return the last matching resource permission
213            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
214            */
215            public static ResourcePermission findByName_Last(java.lang.String name,
216                    OrderByComparator<ResourcePermission> orderByComparator)
217                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
218                    return getPersistence().findByName_Last(name, orderByComparator);
219            }
220    
221            /**
222            * Returns the last resource permission in the ordered set where name = &#63;.
223            *
224            * @param name the name
225            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
226            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
227            */
228            public static ResourcePermission fetchByName_Last(java.lang.String name,
229                    OrderByComparator<ResourcePermission> orderByComparator) {
230                    return getPersistence().fetchByName_Last(name, orderByComparator);
231            }
232    
233            /**
234            * Returns the resource permissions before and after the current resource permission in the ordered set where name = &#63;.
235            *
236            * @param resourcePermissionId the primary key of the current resource permission
237            * @param name the name
238            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
239            * @return the previous, current, and next resource permission
240            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
241            */
242            public static ResourcePermission[] findByName_PrevAndNext(
243                    long resourcePermissionId, java.lang.String name,
244                    OrderByComparator<ResourcePermission> orderByComparator)
245                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
246                    return getPersistence()
247                                       .findByName_PrevAndNext(resourcePermissionId, name,
248                            orderByComparator);
249            }
250    
251            /**
252            * Removes all the resource permissions where name = &#63; from the database.
253            *
254            * @param name the name
255            */
256            public static void removeByName(java.lang.String name) {
257                    getPersistence().removeByName(name);
258            }
259    
260            /**
261            * Returns the number of resource permissions where name = &#63;.
262            *
263            * @param name the name
264            * @return the number of matching resource permissions
265            */
266            public static int countByName(java.lang.String name) {
267                    return getPersistence().countByName(name);
268            }
269    
270            /**
271            * Returns all the resource permissions where scope = &#63;.
272            *
273            * @param scope the scope
274            * @return the matching resource permissions
275            */
276            public static List<ResourcePermission> findByScope(int scope) {
277                    return getPersistence().findByScope(scope);
278            }
279    
280            /**
281            * Returns a range of all the resource permissions where scope = &#63;.
282            *
283            * <p>
284            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
285            * </p>
286            *
287            * @param scope the scope
288            * @param start the lower bound of the range of resource permissions
289            * @param end the upper bound of the range of resource permissions (not inclusive)
290            * @return the range of matching resource permissions
291            */
292            public static List<ResourcePermission> findByScope(int scope, int start,
293                    int end) {
294                    return getPersistence().findByScope(scope, start, end);
295            }
296    
297            /**
298            * Returns an ordered range of all the resource permissions where scope = &#63;.
299            *
300            * <p>
301            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
302            * </p>
303            *
304            * @param scope the scope
305            * @param start the lower bound of the range of resource permissions
306            * @param end the upper bound of the range of resource permissions (not inclusive)
307            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
308            * @return the ordered range of matching resource permissions
309            */
310            public static List<ResourcePermission> findByScope(int scope, int start,
311                    int end, OrderByComparator<ResourcePermission> orderByComparator) {
312                    return getPersistence().findByScope(scope, start, end, orderByComparator);
313            }
314    
315            /**
316            * Returns an ordered range of all the resource permissions where scope = &#63;.
317            *
318            * <p>
319            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
320            * </p>
321            *
322            * @param scope the scope
323            * @param start the lower bound of the range of resource permissions
324            * @param end the upper bound of the range of resource permissions (not inclusive)
325            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
326            * @param retrieveFromCache whether to retrieve from the finder cache
327            * @return the ordered range of matching resource permissions
328            */
329            public static List<ResourcePermission> findByScope(int scope, int start,
330                    int end, OrderByComparator<ResourcePermission> orderByComparator,
331                    boolean retrieveFromCache) {
332                    return getPersistence()
333                                       .findByScope(scope, start, end, orderByComparator,
334                            retrieveFromCache);
335            }
336    
337            /**
338            * Returns the first resource permission in the ordered set where scope = &#63;.
339            *
340            * @param scope the scope
341            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
342            * @return the first matching resource permission
343            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
344            */
345            public static ResourcePermission findByScope_First(int scope,
346                    OrderByComparator<ResourcePermission> orderByComparator)
347                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
348                    return getPersistence().findByScope_First(scope, orderByComparator);
349            }
350    
351            /**
352            * Returns the first resource permission in the ordered set where scope = &#63;.
353            *
354            * @param scope the scope
355            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
356            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
357            */
358            public static ResourcePermission fetchByScope_First(int scope,
359                    OrderByComparator<ResourcePermission> orderByComparator) {
360                    return getPersistence().fetchByScope_First(scope, orderByComparator);
361            }
362    
363            /**
364            * Returns the last resource permission in the ordered set where scope = &#63;.
365            *
366            * @param scope the scope
367            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
368            * @return the last matching resource permission
369            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
370            */
371            public static ResourcePermission findByScope_Last(int scope,
372                    OrderByComparator<ResourcePermission> orderByComparator)
373                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
374                    return getPersistence().findByScope_Last(scope, orderByComparator);
375            }
376    
377            /**
378            * Returns the last resource permission in the ordered set where scope = &#63;.
379            *
380            * @param scope the scope
381            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
382            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
383            */
384            public static ResourcePermission fetchByScope_Last(int scope,
385                    OrderByComparator<ResourcePermission> orderByComparator) {
386                    return getPersistence().fetchByScope_Last(scope, orderByComparator);
387            }
388    
389            /**
390            * Returns the resource permissions before and after the current resource permission in the ordered set where scope = &#63;.
391            *
392            * @param resourcePermissionId the primary key of the current resource permission
393            * @param scope the scope
394            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
395            * @return the previous, current, and next resource permission
396            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
397            */
398            public static ResourcePermission[] findByScope_PrevAndNext(
399                    long resourcePermissionId, int scope,
400                    OrderByComparator<ResourcePermission> orderByComparator)
401                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
402                    return getPersistence()
403                                       .findByScope_PrevAndNext(resourcePermissionId, scope,
404                            orderByComparator);
405            }
406    
407            /**
408            * Returns all the resource permissions where scope = any &#63;.
409            *
410            * <p>
411            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
412            * </p>
413            *
414            * @param scopes the scopes
415            * @return the matching resource permissions
416            */
417            public static List<ResourcePermission> findByScope(int[] scopes) {
418                    return getPersistence().findByScope(scopes);
419            }
420    
421            /**
422            * Returns a range of all the resource permissions where scope = any &#63;.
423            *
424            * <p>
425            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
426            * </p>
427            *
428            * @param scopes the scopes
429            * @param start the lower bound of the range of resource permissions
430            * @param end the upper bound of the range of resource permissions (not inclusive)
431            * @return the range of matching resource permissions
432            */
433            public static List<ResourcePermission> findByScope(int[] scopes, int start,
434                    int end) {
435                    return getPersistence().findByScope(scopes, start, end);
436            }
437    
438            /**
439            * Returns an ordered range of all the resource permissions where scope = any &#63;.
440            *
441            * <p>
442            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
443            * </p>
444            *
445            * @param scopes the scopes
446            * @param start the lower bound of the range of resource permissions
447            * @param end the upper bound of the range of resource permissions (not inclusive)
448            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
449            * @return the ordered range of matching resource permissions
450            */
451            public static List<ResourcePermission> findByScope(int[] scopes, int start,
452                    int end, OrderByComparator<ResourcePermission> orderByComparator) {
453                    return getPersistence()
454                                       .findByScope(scopes, start, end, orderByComparator);
455            }
456    
457            /**
458            * Returns an ordered range of all the resource permissions where scope = &#63;, optionally using the finder cache.
459            *
460            * <p>
461            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
462            * </p>
463            *
464            * @param scope the scope
465            * @param start the lower bound of the range of resource permissions
466            * @param end the upper bound of the range of resource permissions (not inclusive)
467            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
468            * @param retrieveFromCache whether to retrieve from the finder cache
469            * @return the ordered range of matching resource permissions
470            */
471            public static List<ResourcePermission> findByScope(int[] scopes, int start,
472                    int end, OrderByComparator<ResourcePermission> orderByComparator,
473                    boolean retrieveFromCache) {
474                    return getPersistence()
475                                       .findByScope(scopes, start, end, orderByComparator,
476                            retrieveFromCache);
477            }
478    
479            /**
480            * Removes all the resource permissions where scope = &#63; from the database.
481            *
482            * @param scope the scope
483            */
484            public static void removeByScope(int scope) {
485                    getPersistence().removeByScope(scope);
486            }
487    
488            /**
489            * Returns the number of resource permissions where scope = &#63;.
490            *
491            * @param scope the scope
492            * @return the number of matching resource permissions
493            */
494            public static int countByScope(int scope) {
495                    return getPersistence().countByScope(scope);
496            }
497    
498            /**
499            * Returns the number of resource permissions where scope = any &#63;.
500            *
501            * @param scopes the scopes
502            * @return the number of matching resource permissions
503            */
504            public static int countByScope(int[] scopes) {
505                    return getPersistence().countByScope(scopes);
506            }
507    
508            /**
509            * Returns all the resource permissions where roleId = &#63;.
510            *
511            * @param roleId the role ID
512            * @return the matching resource permissions
513            */
514            public static List<ResourcePermission> findByRoleId(long roleId) {
515                    return getPersistence().findByRoleId(roleId);
516            }
517    
518            /**
519            * Returns a range of all the resource permissions where roleId = &#63;.
520            *
521            * <p>
522            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
523            * </p>
524            *
525            * @param roleId the role ID
526            * @param start the lower bound of the range of resource permissions
527            * @param end the upper bound of the range of resource permissions (not inclusive)
528            * @return the range of matching resource permissions
529            */
530            public static List<ResourcePermission> findByRoleId(long roleId, int start,
531                    int end) {
532                    return getPersistence().findByRoleId(roleId, start, end);
533            }
534    
535            /**
536            * Returns an ordered range of all the resource permissions where roleId = &#63;.
537            *
538            * <p>
539            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
540            * </p>
541            *
542            * @param roleId the role ID
543            * @param start the lower bound of the range of resource permissions
544            * @param end the upper bound of the range of resource permissions (not inclusive)
545            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
546            * @return the ordered range of matching resource permissions
547            */
548            public static List<ResourcePermission> findByRoleId(long roleId, int start,
549                    int end, OrderByComparator<ResourcePermission> orderByComparator) {
550                    return getPersistence()
551                                       .findByRoleId(roleId, start, end, orderByComparator);
552            }
553    
554            /**
555            * Returns an ordered range of all the resource permissions where roleId = &#63;.
556            *
557            * <p>
558            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
559            * </p>
560            *
561            * @param roleId the role ID
562            * @param start the lower bound of the range of resource permissions
563            * @param end the upper bound of the range of resource permissions (not inclusive)
564            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
565            * @param retrieveFromCache whether to retrieve from the finder cache
566            * @return the ordered range of matching resource permissions
567            */
568            public static List<ResourcePermission> findByRoleId(long roleId, int start,
569                    int end, OrderByComparator<ResourcePermission> orderByComparator,
570                    boolean retrieveFromCache) {
571                    return getPersistence()
572                                       .findByRoleId(roleId, start, end, orderByComparator,
573                            retrieveFromCache);
574            }
575    
576            /**
577            * Returns the first resource permission in the ordered set where roleId = &#63;.
578            *
579            * @param roleId the role ID
580            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
581            * @return the first matching resource permission
582            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
583            */
584            public static ResourcePermission findByRoleId_First(long roleId,
585                    OrderByComparator<ResourcePermission> orderByComparator)
586                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
587                    return getPersistence().findByRoleId_First(roleId, orderByComparator);
588            }
589    
590            /**
591            * Returns the first resource permission in the ordered set where roleId = &#63;.
592            *
593            * @param roleId the role ID
594            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
595            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
596            */
597            public static ResourcePermission fetchByRoleId_First(long roleId,
598                    OrderByComparator<ResourcePermission> orderByComparator) {
599                    return getPersistence().fetchByRoleId_First(roleId, orderByComparator);
600            }
601    
602            /**
603            * Returns the last resource permission in the ordered set where roleId = &#63;.
604            *
605            * @param roleId the role ID
606            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
607            * @return the last matching resource permission
608            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
609            */
610            public static ResourcePermission findByRoleId_Last(long roleId,
611                    OrderByComparator<ResourcePermission> orderByComparator)
612                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
613                    return getPersistence().findByRoleId_Last(roleId, orderByComparator);
614            }
615    
616            /**
617            * Returns the last resource permission in the ordered set where roleId = &#63;.
618            *
619            * @param roleId the role ID
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            */
623            public static ResourcePermission fetchByRoleId_Last(long roleId,
624                    OrderByComparator<ResourcePermission> orderByComparator) {
625                    return getPersistence().fetchByRoleId_Last(roleId, orderByComparator);
626            }
627    
628            /**
629            * Returns the resource permissions before and after the current resource permission in the ordered set where roleId = &#63;.
630            *
631            * @param resourcePermissionId the primary key of the current resource permission
632            * @param roleId the role ID
633            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
634            * @return the previous, current, and next resource permission
635            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
636            */
637            public static ResourcePermission[] findByRoleId_PrevAndNext(
638                    long resourcePermissionId, long roleId,
639                    OrderByComparator<ResourcePermission> orderByComparator)
640                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
641                    return getPersistence()
642                                       .findByRoleId_PrevAndNext(resourcePermissionId, roleId,
643                            orderByComparator);
644            }
645    
646            /**
647            * Removes all the resource permissions where roleId = &#63; from the database.
648            *
649            * @param roleId the role ID
650            */
651            public static void removeByRoleId(long roleId) {
652                    getPersistence().removeByRoleId(roleId);
653            }
654    
655            /**
656            * Returns the number of resource permissions where roleId = &#63;.
657            *
658            * @param roleId the role ID
659            * @return the number of matching resource permissions
660            */
661            public static int countByRoleId(long roleId) {
662                    return getPersistence().countByRoleId(roleId);
663            }
664    
665            /**
666            * Returns all the 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 matching resource permissions
671            */
672            public static List<ResourcePermission> findByC_LikeP(long companyId,
673                    java.lang.String primKey) {
674                    return getPersistence().findByC_LikeP(companyId, primKey);
675            }
676    
677            /**
678            * Returns a range of all the resource permissions where companyId = &#63; and primKey LIKE &#63;.
679            *
680            * <p>
681            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
682            * </p>
683            *
684            * @param companyId the company ID
685            * @param primKey the prim key
686            * @param start the lower bound of the range of resource permissions
687            * @param end the upper bound of the range of resource permissions (not inclusive)
688            * @return the range of matching resource permissions
689            */
690            public static List<ResourcePermission> findByC_LikeP(long companyId,
691                    java.lang.String primKey, int start, int end) {
692                    return getPersistence().findByC_LikeP(companyId, primKey, start, end);
693            }
694    
695            /**
696            * Returns an ordered range of all the resource permissions where companyId = &#63; and primKey LIKE &#63;.
697            *
698            * <p>
699            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
700            * </p>
701            *
702            * @param companyId the company ID
703            * @param primKey the prim key
704            * @param start the lower bound of the range of resource permissions
705            * @param end the upper bound of the range of resource permissions (not inclusive)
706            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
707            * @return the ordered range of matching resource permissions
708            */
709            public static List<ResourcePermission> findByC_LikeP(long companyId,
710                    java.lang.String primKey, int start, int end,
711                    OrderByComparator<ResourcePermission> orderByComparator) {
712                    return getPersistence()
713                                       .findByC_LikeP(companyId, primKey, start, end,
714                            orderByComparator);
715            }
716    
717            /**
718            * Returns an ordered range of all the resource permissions where companyId = &#63; and primKey LIKE &#63;.
719            *
720            * <p>
721            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
722            * </p>
723            *
724            * @param companyId the company ID
725            * @param primKey the prim key
726            * @param start the lower bound of the range of resource permissions
727            * @param end the upper bound of the range of resource permissions (not inclusive)
728            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
729            * @param retrieveFromCache whether to retrieve from the finder cache
730            * @return the ordered range of matching resource permissions
731            */
732            public static List<ResourcePermission> findByC_LikeP(long companyId,
733                    java.lang.String primKey, int start, int end,
734                    OrderByComparator<ResourcePermission> orderByComparator,
735                    boolean retrieveFromCache) {
736                    return getPersistence()
737                                       .findByC_LikeP(companyId, primKey, start, end,
738                            orderByComparator, retrieveFromCache);
739            }
740    
741            /**
742            * Returns the first resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
743            *
744            * @param companyId the company ID
745            * @param primKey the prim key
746            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
747            * @return the first matching resource permission
748            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
749            */
750            public static ResourcePermission findByC_LikeP_First(long companyId,
751                    java.lang.String primKey,
752                    OrderByComparator<ResourcePermission> orderByComparator)
753                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
754                    return getPersistence()
755                                       .findByC_LikeP_First(companyId, primKey, orderByComparator);
756            }
757    
758            /**
759            * Returns the first resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
760            *
761            * @param companyId the company ID
762            * @param primKey the prim key
763            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
764            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
765            */
766            public static ResourcePermission fetchByC_LikeP_First(long companyId,
767                    java.lang.String primKey,
768                    OrderByComparator<ResourcePermission> orderByComparator) {
769                    return getPersistence()
770                                       .fetchByC_LikeP_First(companyId, primKey, orderByComparator);
771            }
772    
773            /**
774            * Returns the last resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
775            *
776            * @param companyId the company ID
777            * @param primKey the prim key
778            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
779            * @return the last matching resource permission
780            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
781            */
782            public static ResourcePermission findByC_LikeP_Last(long companyId,
783                    java.lang.String primKey,
784                    OrderByComparator<ResourcePermission> orderByComparator)
785                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
786                    return getPersistence()
787                                       .findByC_LikeP_Last(companyId, primKey, orderByComparator);
788            }
789    
790            /**
791            * Returns the last resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
792            *
793            * @param companyId the company ID
794            * @param primKey the prim key
795            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
796            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
797            */
798            public static ResourcePermission fetchByC_LikeP_Last(long companyId,
799                    java.lang.String primKey,
800                    OrderByComparator<ResourcePermission> orderByComparator) {
801                    return getPersistence()
802                                       .fetchByC_LikeP_Last(companyId, primKey, orderByComparator);
803            }
804    
805            /**
806            * Returns the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and primKey LIKE &#63;.
807            *
808            * @param resourcePermissionId the primary key of the current resource permission
809            * @param companyId the company ID
810            * @param primKey the prim key
811            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
812            * @return the previous, current, and next resource permission
813            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
814            */
815            public static ResourcePermission[] findByC_LikeP_PrevAndNext(
816                    long resourcePermissionId, long companyId, java.lang.String primKey,
817                    OrderByComparator<ResourcePermission> orderByComparator)
818                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
819                    return getPersistence()
820                                       .findByC_LikeP_PrevAndNext(resourcePermissionId, companyId,
821                            primKey, orderByComparator);
822            }
823    
824            /**
825            * Removes all the resource permissions where companyId = &#63; and primKey LIKE &#63; from the database.
826            *
827            * @param companyId the company ID
828            * @param primKey the prim key
829            */
830            public static void removeByC_LikeP(long companyId, java.lang.String primKey) {
831                    getPersistence().removeByC_LikeP(companyId, primKey);
832            }
833    
834            /**
835            * Returns the number of resource permissions where companyId = &#63; and primKey LIKE &#63;.
836            *
837            * @param companyId the company ID
838            * @param primKey the prim key
839            * @return the number of matching resource permissions
840            */
841            public static int countByC_LikeP(long companyId, java.lang.String primKey) {
842                    return getPersistence().countByC_LikeP(companyId, primKey);
843            }
844    
845            /**
846            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
847            *
848            * @param companyId the company ID
849            * @param name the name
850            * @param scope the scope
851            * @return the matching resource permissions
852            */
853            public static List<ResourcePermission> findByC_N_S(long companyId,
854                    java.lang.String name, int scope) {
855                    return getPersistence().findByC_N_S(companyId, name, scope);
856            }
857    
858            /**
859            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
860            *
861            * <p>
862            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
863            * </p>
864            *
865            * @param companyId the company ID
866            * @param name the name
867            * @param scope the scope
868            * @param start the lower bound of the range of resource permissions
869            * @param end the upper bound of the range of resource permissions (not inclusive)
870            * @return the range of matching resource permissions
871            */
872            public static List<ResourcePermission> findByC_N_S(long companyId,
873                    java.lang.String name, int scope, int start, int end) {
874                    return getPersistence().findByC_N_S(companyId, name, scope, start, end);
875            }
876    
877            /**
878            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
879            *
880            * <p>
881            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
882            * </p>
883            *
884            * @param companyId the company ID
885            * @param name the name
886            * @param scope the scope
887            * @param start the lower bound of the range of resource permissions
888            * @param end the upper bound of the range of resource permissions (not inclusive)
889            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
890            * @return the ordered range of matching resource permissions
891            */
892            public static List<ResourcePermission> findByC_N_S(long companyId,
893                    java.lang.String name, int scope, int start, int end,
894                    OrderByComparator<ResourcePermission> orderByComparator) {
895                    return getPersistence()
896                                       .findByC_N_S(companyId, name, scope, start, end,
897                            orderByComparator);
898            }
899    
900            /**
901            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
902            *
903            * <p>
904            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
905            * </p>
906            *
907            * @param companyId the company ID
908            * @param name the name
909            * @param scope the scope
910            * @param start the lower bound of the range of resource permissions
911            * @param end the upper bound of the range of resource permissions (not inclusive)
912            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
913            * @param retrieveFromCache whether to retrieve from the finder cache
914            * @return the ordered range of matching resource permissions
915            */
916            public static List<ResourcePermission> findByC_N_S(long companyId,
917                    java.lang.String name, int scope, int start, int end,
918                    OrderByComparator<ResourcePermission> orderByComparator,
919                    boolean retrieveFromCache) {
920                    return getPersistence()
921                                       .findByC_N_S(companyId, name, scope, start, end,
922                            orderByComparator, retrieveFromCache);
923            }
924    
925            /**
926            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
927            *
928            * @param companyId the company ID
929            * @param name the name
930            * @param scope the scope
931            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
932            * @return the first matching resource permission
933            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
934            */
935            public static ResourcePermission findByC_N_S_First(long companyId,
936                    java.lang.String name, int scope,
937                    OrderByComparator<ResourcePermission> orderByComparator)
938                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
939                    return getPersistence()
940                                       .findByC_N_S_First(companyId, name, scope, orderByComparator);
941            }
942    
943            /**
944            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
945            *
946            * @param companyId the company ID
947            * @param name the name
948            * @param scope the scope
949            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
950            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
951            */
952            public static ResourcePermission fetchByC_N_S_First(long companyId,
953                    java.lang.String name, int scope,
954                    OrderByComparator<ResourcePermission> orderByComparator) {
955                    return getPersistence()
956                                       .fetchByC_N_S_First(companyId, name, scope, orderByComparator);
957            }
958    
959            /**
960            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
961            *
962            * @param companyId the company ID
963            * @param name the name
964            * @param scope the scope
965            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
966            * @return the last matching resource permission
967            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
968            */
969            public static ResourcePermission findByC_N_S_Last(long companyId,
970                    java.lang.String name, int scope,
971                    OrderByComparator<ResourcePermission> orderByComparator)
972                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
973                    return getPersistence()
974                                       .findByC_N_S_Last(companyId, name, scope, orderByComparator);
975            }
976    
977            /**
978            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
979            *
980            * @param companyId the company ID
981            * @param name the name
982            * @param scope the scope
983            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
984            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
985            */
986            public static ResourcePermission fetchByC_N_S_Last(long companyId,
987                    java.lang.String name, int scope,
988                    OrderByComparator<ResourcePermission> orderByComparator) {
989                    return getPersistence()
990                                       .fetchByC_N_S_Last(companyId, name, scope, orderByComparator);
991            }
992    
993            /**
994            * Returns the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
995            *
996            * @param resourcePermissionId the primary key of the current resource permission
997            * @param companyId the company ID
998            * @param name the name
999            * @param scope the scope
1000            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1001            * @return the previous, current, and next resource permission
1002            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
1003            */
1004            public static ResourcePermission[] findByC_N_S_PrevAndNext(
1005                    long resourcePermissionId, long companyId, java.lang.String name,
1006                    int scope, OrderByComparator<ResourcePermission> orderByComparator)
1007                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1008                    return getPersistence()
1009                                       .findByC_N_S_PrevAndNext(resourcePermissionId, companyId,
1010                            name, scope, orderByComparator);
1011            }
1012    
1013            /**
1014            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; from the database.
1015            *
1016            * @param companyId the company ID
1017            * @param name the name
1018            * @param scope the scope
1019            */
1020            public static void removeByC_N_S(long companyId, java.lang.String name,
1021                    int scope) {
1022                    getPersistence().removeByC_N_S(companyId, name, scope);
1023            }
1024    
1025            /**
1026            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
1027            *
1028            * @param companyId the company ID
1029            * @param name the name
1030            * @param scope the scope
1031            * @return the number of matching resource permissions
1032            */
1033            public static int countByC_N_S(long companyId, java.lang.String name,
1034                    int scope) {
1035                    return getPersistence().countByC_N_S(companyId, name, scope);
1036            }
1037    
1038            /**
1039            * Returns all the resource permissions where companyId = &#63; and scope = &#63; and primKey = &#63;.
1040            *
1041            * @param companyId the company ID
1042            * @param scope the scope
1043            * @param primKey the prim key
1044            * @return the matching resource permissions
1045            */
1046            public static List<ResourcePermission> findByC_S_P(long companyId,
1047                    int scope, java.lang.String primKey) {
1048                    return getPersistence().findByC_S_P(companyId, scope, primKey);
1049            }
1050    
1051            /**
1052            * Returns a range of all the resource permissions where companyId = &#63; and scope = &#63; and primKey = &#63;.
1053            *
1054            * <p>
1055            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1056            * </p>
1057            *
1058            * @param companyId the company ID
1059            * @param scope the scope
1060            * @param primKey the prim key
1061            * @param start the lower bound of the range of resource permissions
1062            * @param end the upper bound of the range of resource permissions (not inclusive)
1063            * @return the range of matching resource permissions
1064            */
1065            public static List<ResourcePermission> findByC_S_P(long companyId,
1066                    int scope, java.lang.String primKey, int start, int end) {
1067                    return getPersistence()
1068                                       .findByC_S_P(companyId, scope, primKey, start, end);
1069            }
1070    
1071            /**
1072            * Returns an ordered range of all the resource permissions where companyId = &#63; and scope = &#63; and primKey = &#63;.
1073            *
1074            * <p>
1075            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1076            * </p>
1077            *
1078            * @param companyId the company ID
1079            * @param scope the scope
1080            * @param primKey the prim key
1081            * @param start the lower bound of the range of resource permissions
1082            * @param end the upper bound of the range of resource permissions (not inclusive)
1083            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1084            * @return the ordered range of matching resource permissions
1085            */
1086            public static List<ResourcePermission> findByC_S_P(long companyId,
1087                    int scope, java.lang.String primKey, int start, int end,
1088                    OrderByComparator<ResourcePermission> orderByComparator) {
1089                    return getPersistence()
1090                                       .findByC_S_P(companyId, scope, primKey, start, end,
1091                            orderByComparator);
1092            }
1093    
1094            /**
1095            * Returns an ordered range of all the resource permissions where companyId = &#63; and scope = &#63; and primKey = &#63;.
1096            *
1097            * <p>
1098            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1099            * </p>
1100            *
1101            * @param companyId the company ID
1102            * @param scope the scope
1103            * @param primKey the prim key
1104            * @param start the lower bound of the range of resource permissions
1105            * @param end the upper bound of the range of resource permissions (not inclusive)
1106            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1107            * @param retrieveFromCache whether to retrieve from the finder cache
1108            * @return the ordered range of matching resource permissions
1109            */
1110            public static List<ResourcePermission> findByC_S_P(long companyId,
1111                    int scope, java.lang.String primKey, int start, int end,
1112                    OrderByComparator<ResourcePermission> orderByComparator,
1113                    boolean retrieveFromCache) {
1114                    return getPersistence()
1115                                       .findByC_S_P(companyId, scope, primKey, start, end,
1116                            orderByComparator, retrieveFromCache);
1117            }
1118    
1119            /**
1120            * Returns the first resource permission in the ordered set where companyId = &#63; and scope = &#63; and primKey = &#63;.
1121            *
1122            * @param companyId the company ID
1123            * @param scope the scope
1124            * @param primKey the prim key
1125            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1126            * @return the first matching resource permission
1127            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
1128            */
1129            public static ResourcePermission findByC_S_P_First(long companyId,
1130                    int scope, java.lang.String primKey,
1131                    OrderByComparator<ResourcePermission> orderByComparator)
1132                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1133                    return getPersistence()
1134                                       .findByC_S_P_First(companyId, scope, primKey,
1135                            orderByComparator);
1136            }
1137    
1138            /**
1139            * Returns the first resource permission in the ordered set where companyId = &#63; and scope = &#63; and primKey = &#63;.
1140            *
1141            * @param companyId the company ID
1142            * @param scope the scope
1143            * @param primKey the prim key
1144            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1145            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
1146            */
1147            public static ResourcePermission fetchByC_S_P_First(long companyId,
1148                    int scope, java.lang.String primKey,
1149                    OrderByComparator<ResourcePermission> orderByComparator) {
1150                    return getPersistence()
1151                                       .fetchByC_S_P_First(companyId, scope, primKey,
1152                            orderByComparator);
1153            }
1154    
1155            /**
1156            * Returns the last resource permission in the ordered set where companyId = &#63; and scope = &#63; and primKey = &#63;.
1157            *
1158            * @param companyId the company ID
1159            * @param scope the scope
1160            * @param primKey the prim key
1161            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1162            * @return the last matching resource permission
1163            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
1164            */
1165            public static ResourcePermission findByC_S_P_Last(long companyId,
1166                    int scope, java.lang.String primKey,
1167                    OrderByComparator<ResourcePermission> orderByComparator)
1168                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1169                    return getPersistence()
1170                                       .findByC_S_P_Last(companyId, scope, primKey,
1171                            orderByComparator);
1172            }
1173    
1174            /**
1175            * Returns the last resource permission in the ordered set where companyId = &#63; and scope = &#63; and primKey = &#63;.
1176            *
1177            * @param companyId the company ID
1178            * @param scope the scope
1179            * @param primKey the prim key
1180            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1181            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
1182            */
1183            public static ResourcePermission fetchByC_S_P_Last(long companyId,
1184                    int scope, java.lang.String primKey,
1185                    OrderByComparator<ResourcePermission> orderByComparator) {
1186                    return getPersistence()
1187                                       .fetchByC_S_P_Last(companyId, scope, primKey,
1188                            orderByComparator);
1189            }
1190    
1191            /**
1192            * Returns the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and scope = &#63; and primKey = &#63;.
1193            *
1194            * @param resourcePermissionId the primary key of the current resource permission
1195            * @param companyId the company ID
1196            * @param scope the scope
1197            * @param primKey the prim key
1198            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1199            * @return the previous, current, and next resource permission
1200            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
1201            */
1202            public static ResourcePermission[] findByC_S_P_PrevAndNext(
1203                    long resourcePermissionId, long companyId, int scope,
1204                    java.lang.String primKey,
1205                    OrderByComparator<ResourcePermission> orderByComparator)
1206                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1207                    return getPersistence()
1208                                       .findByC_S_P_PrevAndNext(resourcePermissionId, companyId,
1209                            scope, primKey, orderByComparator);
1210            }
1211    
1212            /**
1213            * Removes all the resource permissions where companyId = &#63; and scope = &#63; and primKey = &#63; from the database.
1214            *
1215            * @param companyId the company ID
1216            * @param scope the scope
1217            * @param primKey the prim key
1218            */
1219            public static void removeByC_S_P(long companyId, int scope,
1220                    java.lang.String primKey) {
1221                    getPersistence().removeByC_S_P(companyId, scope, primKey);
1222            }
1223    
1224            /**
1225            * Returns the number of resource permissions where companyId = &#63; and scope = &#63; and primKey = &#63;.
1226            *
1227            * @param companyId the company ID
1228            * @param scope the scope
1229            * @param primKey the prim key
1230            * @return the number of matching resource permissions
1231            */
1232            public static int countByC_S_P(long companyId, int scope,
1233                    java.lang.String primKey) {
1234                    return getPersistence().countByC_S_P(companyId, scope, primKey);
1235            }
1236    
1237            /**
1238            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1239            *
1240            * @param companyId the company ID
1241            * @param name the name
1242            * @param scope the scope
1243            * @param primKey the prim key
1244            * @return the matching resource permissions
1245            */
1246            public static List<ResourcePermission> findByC_N_S_P(long companyId,
1247                    java.lang.String name, int scope, java.lang.String primKey) {
1248                    return getPersistence().findByC_N_S_P(companyId, name, scope, primKey);
1249            }
1250    
1251            /**
1252            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1253            *
1254            * <p>
1255            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1256            * </p>
1257            *
1258            * @param companyId the company ID
1259            * @param name the name
1260            * @param scope the scope
1261            * @param primKey the prim key
1262            * @param start the lower bound of the range of resource permissions
1263            * @param end the upper bound of the range of resource permissions (not inclusive)
1264            * @return the range of matching resource permissions
1265            */
1266            public static List<ResourcePermission> findByC_N_S_P(long companyId,
1267                    java.lang.String name, int scope, java.lang.String primKey, int start,
1268                    int end) {
1269                    return getPersistence()
1270                                       .findByC_N_S_P(companyId, name, scope, primKey, start, end);
1271            }
1272    
1273            /**
1274            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1275            *
1276            * <p>
1277            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1278            * </p>
1279            *
1280            * @param companyId the company ID
1281            * @param name the name
1282            * @param scope the scope
1283            * @param primKey the prim key
1284            * @param start the lower bound of the range of resource permissions
1285            * @param end the upper bound of the range of resource permissions (not inclusive)
1286            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1287            * @return the ordered range of matching resource permissions
1288            */
1289            public static List<ResourcePermission> findByC_N_S_P(long companyId,
1290                    java.lang.String name, int scope, java.lang.String primKey, int start,
1291                    int end, OrderByComparator<ResourcePermission> orderByComparator) {
1292                    return getPersistence()
1293                                       .findByC_N_S_P(companyId, name, scope, primKey, start, end,
1294                            orderByComparator);
1295            }
1296    
1297            /**
1298            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1299            *
1300            * <p>
1301            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1302            * </p>
1303            *
1304            * @param companyId the company ID
1305            * @param name the name
1306            * @param scope the scope
1307            * @param primKey the prim key
1308            * @param start the lower bound of the range of resource permissions
1309            * @param end the upper bound of the range of resource permissions (not inclusive)
1310            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1311            * @param retrieveFromCache whether to retrieve from the finder cache
1312            * @return the ordered range of matching resource permissions
1313            */
1314            public static List<ResourcePermission> findByC_N_S_P(long companyId,
1315                    java.lang.String name, int scope, java.lang.String primKey, int start,
1316                    int end, OrderByComparator<ResourcePermission> orderByComparator,
1317                    boolean retrieveFromCache) {
1318                    return getPersistence()
1319                                       .findByC_N_S_P(companyId, name, scope, primKey, start, end,
1320                            orderByComparator, retrieveFromCache);
1321            }
1322    
1323            /**
1324            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1325            *
1326            * @param companyId the company ID
1327            * @param name the name
1328            * @param scope the scope
1329            * @param primKey the prim key
1330            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1331            * @return the first matching resource permission
1332            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
1333            */
1334            public static ResourcePermission findByC_N_S_P_First(long companyId,
1335                    java.lang.String name, int scope, java.lang.String primKey,
1336                    OrderByComparator<ResourcePermission> orderByComparator)
1337                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1338                    return getPersistence()
1339                                       .findByC_N_S_P_First(companyId, name, scope, primKey,
1340                            orderByComparator);
1341            }
1342    
1343            /**
1344            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1345            *
1346            * @param companyId the company ID
1347            * @param name the name
1348            * @param scope the scope
1349            * @param primKey the prim key
1350            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1351            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
1352            */
1353            public static ResourcePermission fetchByC_N_S_P_First(long companyId,
1354                    java.lang.String name, int scope, java.lang.String primKey,
1355                    OrderByComparator<ResourcePermission> orderByComparator) {
1356                    return getPersistence()
1357                                       .fetchByC_N_S_P_First(companyId, name, scope, primKey,
1358                            orderByComparator);
1359            }
1360    
1361            /**
1362            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1363            *
1364            * @param companyId the company ID
1365            * @param name the name
1366            * @param scope the scope
1367            * @param primKey the prim key
1368            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1369            * @return the last matching resource permission
1370            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
1371            */
1372            public static ResourcePermission findByC_N_S_P_Last(long companyId,
1373                    java.lang.String name, int scope, java.lang.String primKey,
1374                    OrderByComparator<ResourcePermission> orderByComparator)
1375                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1376                    return getPersistence()
1377                                       .findByC_N_S_P_Last(companyId, name, scope, primKey,
1378                            orderByComparator);
1379            }
1380    
1381            /**
1382            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1383            *
1384            * @param companyId the company ID
1385            * @param name the name
1386            * @param scope the scope
1387            * @param primKey the prim key
1388            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1389            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
1390            */
1391            public static ResourcePermission fetchByC_N_S_P_Last(long companyId,
1392                    java.lang.String name, int scope, java.lang.String primKey,
1393                    OrderByComparator<ResourcePermission> orderByComparator) {
1394                    return getPersistence()
1395                                       .fetchByC_N_S_P_Last(companyId, name, scope, primKey,
1396                            orderByComparator);
1397            }
1398    
1399            /**
1400            * 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;.
1401            *
1402            * @param resourcePermissionId the primary key of the current resource permission
1403            * @param companyId the company ID
1404            * @param name the name
1405            * @param scope the scope
1406            * @param primKey the prim key
1407            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1408            * @return the previous, current, and next resource permission
1409            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
1410            */
1411            public static ResourcePermission[] findByC_N_S_P_PrevAndNext(
1412                    long resourcePermissionId, long companyId, java.lang.String name,
1413                    int scope, java.lang.String primKey,
1414                    OrderByComparator<ResourcePermission> orderByComparator)
1415                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1416                    return getPersistence()
1417                                       .findByC_N_S_P_PrevAndNext(resourcePermissionId, companyId,
1418                            name, scope, primKey, orderByComparator);
1419            }
1420    
1421            /**
1422            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; from the database.
1423            *
1424            * @param companyId the company ID
1425            * @param name the name
1426            * @param scope the scope
1427            * @param primKey the prim key
1428            */
1429            public static void removeByC_N_S_P(long companyId, java.lang.String name,
1430                    int scope, java.lang.String primKey) {
1431                    getPersistence().removeByC_N_S_P(companyId, name, scope, primKey);
1432            }
1433    
1434            /**
1435            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
1436            *
1437            * @param companyId the company ID
1438            * @param name the name
1439            * @param scope the scope
1440            * @param primKey the prim key
1441            * @return the number of matching resource permissions
1442            */
1443            public static int countByC_N_S_P(long companyId, java.lang.String name,
1444                    int scope, java.lang.String primKey) {
1445                    return getPersistence().countByC_N_S_P(companyId, name, scope, primKey);
1446            }
1447    
1448            /**
1449            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = any &#63;.
1450            *
1451            * <p>
1452            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1453            * </p>
1454            *
1455            * @param companyId the company ID
1456            * @param name the name
1457            * @param scope the scope
1458            * @param primKey the prim key
1459            * @param roleIds the role IDs
1460            * @return the matching resource permissions
1461            */
1462            public static List<ResourcePermission> findByC_N_S_P_R(long companyId,
1463                    java.lang.String name, int scope, java.lang.String primKey,
1464                    long[] roleIds) {
1465                    return getPersistence()
1466                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleIds);
1467            }
1468    
1469            /**
1470            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = any &#63;.
1471            *
1472            * <p>
1473            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1474            * </p>
1475            *
1476            * @param companyId the company ID
1477            * @param name the name
1478            * @param scope the scope
1479            * @param primKey the prim key
1480            * @param roleIds the role IDs
1481            * @param start the lower bound of the range of resource permissions
1482            * @param end the upper bound of the range of resource permissions (not inclusive)
1483            * @return the range of matching resource permissions
1484            */
1485            public static List<ResourcePermission> findByC_N_S_P_R(long companyId,
1486                    java.lang.String name, int scope, java.lang.String primKey,
1487                    long[] roleIds, int start, int end) {
1488                    return getPersistence()
1489                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleIds,
1490                            start, end);
1491            }
1492    
1493            /**
1494            * 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;.
1495            *
1496            * <p>
1497            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1498            * </p>
1499            *
1500            * @param companyId the company ID
1501            * @param name the name
1502            * @param scope the scope
1503            * @param primKey the prim key
1504            * @param roleIds the role IDs
1505            * @param start the lower bound of the range of resource permissions
1506            * @param end the upper bound of the range of resource permissions (not inclusive)
1507            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1508            * @return the ordered range of matching resource permissions
1509            */
1510            public static List<ResourcePermission> findByC_N_S_P_R(long companyId,
1511                    java.lang.String name, int scope, java.lang.String primKey,
1512                    long[] roleIds, int start, int end,
1513                    OrderByComparator<ResourcePermission> orderByComparator) {
1514                    return getPersistence()
1515                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleIds,
1516                            start, end, orderByComparator);
1517            }
1518    
1519            /**
1520            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63;, optionally using the finder cache.
1521            *
1522            * <p>
1523            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1524            * </p>
1525            *
1526            * @param companyId the company ID
1527            * @param name the name
1528            * @param scope the scope
1529            * @param primKey the prim key
1530            * @param roleId the role ID
1531            * @param start the lower bound of the range of resource permissions
1532            * @param end the upper bound of the range of resource permissions (not inclusive)
1533            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1534            * @param retrieveFromCache whether to retrieve from the finder cache
1535            * @return the ordered range of matching resource permissions
1536            */
1537            public static List<ResourcePermission> findByC_N_S_P_R(long companyId,
1538                    java.lang.String name, int scope, java.lang.String primKey,
1539                    long[] roleIds, int start, int end,
1540                    OrderByComparator<ResourcePermission> orderByComparator,
1541                    boolean retrieveFromCache) {
1542                    return getPersistence()
1543                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleIds,
1544                            start, end, orderByComparator, retrieveFromCache);
1545            }
1546    
1547            /**
1548            * Returns the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; or throws a {@link NoSuchResourcePermissionException} if it could not be found.
1549            *
1550            * @param companyId the company ID
1551            * @param name the name
1552            * @param scope the scope
1553            * @param primKey the prim key
1554            * @param roleId the role ID
1555            * @return the matching resource permission
1556            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
1557            */
1558            public static ResourcePermission findByC_N_S_P_R(long companyId,
1559                    java.lang.String name, int scope, java.lang.String primKey, long roleId)
1560                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1561                    return getPersistence()
1562                                       .findByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1563            }
1564    
1565            /**
1566            * 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.
1567            *
1568            * @param companyId the company ID
1569            * @param name the name
1570            * @param scope the scope
1571            * @param primKey the prim key
1572            * @param roleId the role ID
1573            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
1574            */
1575            public static ResourcePermission fetchByC_N_S_P_R(long companyId,
1576                    java.lang.String name, int scope, java.lang.String primKey, long roleId) {
1577                    return getPersistence()
1578                                       .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1579            }
1580    
1581            /**
1582            * 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.
1583            *
1584            * @param companyId the company ID
1585            * @param name the name
1586            * @param scope the scope
1587            * @param primKey the prim key
1588            * @param roleId the role ID
1589            * @param retrieveFromCache whether to retrieve from the finder cache
1590            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
1591            */
1592            public static ResourcePermission fetchByC_N_S_P_R(long companyId,
1593                    java.lang.String name, int scope, java.lang.String primKey,
1594                    long roleId, boolean retrieveFromCache) {
1595                    return getPersistence()
1596                                       .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId,
1597                            retrieveFromCache);
1598            }
1599    
1600            /**
1601            * Removes the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; from the database.
1602            *
1603            * @param companyId the company ID
1604            * @param name the name
1605            * @param scope the scope
1606            * @param primKey the prim key
1607            * @param roleId the role ID
1608            * @return the resource permission that was removed
1609            */
1610            public static ResourcePermission removeByC_N_S_P_R(long companyId,
1611                    java.lang.String name, int scope, java.lang.String primKey, long roleId)
1612                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1613                    return getPersistence()
1614                                       .removeByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1615            }
1616    
1617            /**
1618            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63;.
1619            *
1620            * @param companyId the company ID
1621            * @param name the name
1622            * @param scope the scope
1623            * @param primKey the prim key
1624            * @param roleId the role ID
1625            * @return the number of matching resource permissions
1626            */
1627            public static int countByC_N_S_P_R(long companyId, java.lang.String name,
1628                    int scope, java.lang.String primKey, long roleId) {
1629                    return getPersistence()
1630                                       .countByC_N_S_P_R(companyId, name, scope, primKey, roleId);
1631            }
1632    
1633            /**
1634            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = any &#63;.
1635            *
1636            * @param companyId the company ID
1637            * @param name the name
1638            * @param scope the scope
1639            * @param primKey the prim key
1640            * @param roleIds the role IDs
1641            * @return the number of matching resource permissions
1642            */
1643            public static int countByC_N_S_P_R(long companyId, java.lang.String name,
1644                    int scope, java.lang.String primKey, long[] roleIds) {
1645                    return getPersistence()
1646                                       .countByC_N_S_P_R(companyId, name, scope, primKey, roleIds);
1647            }
1648    
1649            /**
1650            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1651            *
1652            * @param companyId the company ID
1653            * @param name the name
1654            * @param scope the scope
1655            * @param primKeyId the prim key ID
1656            * @param roleId the role ID
1657            * @param viewActionId the view action ID
1658            * @return the matching resource permissions
1659            */
1660            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1661                    java.lang.String name, int scope, long primKeyId, long roleId,
1662                    boolean viewActionId) {
1663                    return getPersistence()
1664                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1665                            roleId, viewActionId);
1666            }
1667    
1668            /**
1669            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1670            *
1671            * <p>
1672            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1673            * </p>
1674            *
1675            * @param companyId the company ID
1676            * @param name the name
1677            * @param scope the scope
1678            * @param primKeyId the prim key ID
1679            * @param roleId the role ID
1680            * @param viewActionId the view action ID
1681            * @param start the lower bound of the range of resource permissions
1682            * @param end the upper bound of the range of resource permissions (not inclusive)
1683            * @return the range of matching resource permissions
1684            */
1685            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1686                    java.lang.String name, int scope, long primKeyId, long roleId,
1687                    boolean viewActionId, int start, int end) {
1688                    return getPersistence()
1689                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1690                            roleId, viewActionId, start, end);
1691            }
1692    
1693            /**
1694            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1695            *
1696            * <p>
1697            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1698            * </p>
1699            *
1700            * @param companyId the company ID
1701            * @param name the name
1702            * @param scope the scope
1703            * @param primKeyId the prim key ID
1704            * @param roleId the role ID
1705            * @param viewActionId the view action ID
1706            * @param start the lower bound of the range of resource permissions
1707            * @param end the upper bound of the range of resource permissions (not inclusive)
1708            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1709            * @return the ordered range of matching resource permissions
1710            */
1711            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1712                    java.lang.String name, int scope, long primKeyId, long roleId,
1713                    boolean viewActionId, int start, int end,
1714                    OrderByComparator<ResourcePermission> orderByComparator) {
1715                    return getPersistence()
1716                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1717                            roleId, viewActionId, start, end, orderByComparator);
1718            }
1719    
1720            /**
1721            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1722            *
1723            * <p>
1724            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1725            * </p>
1726            *
1727            * @param companyId the company ID
1728            * @param name the name
1729            * @param scope the scope
1730            * @param primKeyId the prim key ID
1731            * @param roleId the role ID
1732            * @param viewActionId the view action ID
1733            * @param start the lower bound of the range of resource permissions
1734            * @param end the upper bound of the range of resource permissions (not inclusive)
1735            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1736            * @param retrieveFromCache whether to retrieve from the finder cache
1737            * @return the ordered range of matching resource permissions
1738            */
1739            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1740                    java.lang.String name, int scope, long primKeyId, long roleId,
1741                    boolean viewActionId, int start, int end,
1742                    OrderByComparator<ResourcePermission> orderByComparator,
1743                    boolean retrieveFromCache) {
1744                    return getPersistence()
1745                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1746                            roleId, viewActionId, start, end, orderByComparator,
1747                            retrieveFromCache);
1748            }
1749    
1750            /**
1751            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1752            *
1753            * @param companyId the company ID
1754            * @param name the name
1755            * @param scope the scope
1756            * @param primKeyId the prim key ID
1757            * @param roleId the role ID
1758            * @param viewActionId the view action ID
1759            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1760            * @return the first matching resource permission
1761            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
1762            */
1763            public static ResourcePermission findByC_N_S_P_R_V_First(long companyId,
1764                    java.lang.String name, int scope, long primKeyId, long roleId,
1765                    boolean viewActionId,
1766                    OrderByComparator<ResourcePermission> orderByComparator)
1767                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1768                    return getPersistence()
1769                                       .findByC_N_S_P_R_V_First(companyId, name, scope, primKeyId,
1770                            roleId, viewActionId, orderByComparator);
1771            }
1772    
1773            /**
1774            * Returns the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1775            *
1776            * @param companyId the company ID
1777            * @param name the name
1778            * @param scope the scope
1779            * @param primKeyId the prim key ID
1780            * @param roleId the role ID
1781            * @param viewActionId the view action ID
1782            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1783            * @return the first matching resource permission, or <code>null</code> if a matching resource permission could not be found
1784            */
1785            public static ResourcePermission fetchByC_N_S_P_R_V_First(long companyId,
1786                    java.lang.String name, int scope, long primKeyId, long roleId,
1787                    boolean viewActionId,
1788                    OrderByComparator<ResourcePermission> orderByComparator) {
1789                    return getPersistence()
1790                                       .fetchByC_N_S_P_R_V_First(companyId, name, scope, primKeyId,
1791                            roleId, viewActionId, orderByComparator);
1792            }
1793    
1794            /**
1795            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1796            *
1797            * @param companyId the company ID
1798            * @param name the name
1799            * @param scope the scope
1800            * @param primKeyId the prim key ID
1801            * @param roleId the role ID
1802            * @param viewActionId the view action ID
1803            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1804            * @return the last matching resource permission
1805            * @throws NoSuchResourcePermissionException if a matching resource permission could not be found
1806            */
1807            public static ResourcePermission findByC_N_S_P_R_V_Last(long companyId,
1808                    java.lang.String name, int scope, long primKeyId, long roleId,
1809                    boolean viewActionId,
1810                    OrderByComparator<ResourcePermission> orderByComparator)
1811                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1812                    return getPersistence()
1813                                       .findByC_N_S_P_R_V_Last(companyId, name, scope, primKeyId,
1814                            roleId, viewActionId, orderByComparator);
1815            }
1816    
1817            /**
1818            * Returns the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1819            *
1820            * @param companyId the company ID
1821            * @param name the name
1822            * @param scope the scope
1823            * @param primKeyId the prim key ID
1824            * @param roleId the role ID
1825            * @param viewActionId the view action ID
1826            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1827            * @return the last matching resource permission, or <code>null</code> if a matching resource permission could not be found
1828            */
1829            public static ResourcePermission fetchByC_N_S_P_R_V_Last(long companyId,
1830                    java.lang.String name, int scope, long primKeyId, long roleId,
1831                    boolean viewActionId,
1832                    OrderByComparator<ResourcePermission> orderByComparator) {
1833                    return getPersistence()
1834                                       .fetchByC_N_S_P_R_V_Last(companyId, name, scope, primKeyId,
1835                            roleId, viewActionId, orderByComparator);
1836            }
1837    
1838            /**
1839            * 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 primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1840            *
1841            * @param resourcePermissionId the primary key of the current resource permission
1842            * @param companyId the company ID
1843            * @param name the name
1844            * @param scope the scope
1845            * @param primKeyId the prim key ID
1846            * @param roleId the role ID
1847            * @param viewActionId the view action ID
1848            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1849            * @return the previous, current, and next resource permission
1850            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
1851            */
1852            public static ResourcePermission[] findByC_N_S_P_R_V_PrevAndNext(
1853                    long resourcePermissionId, long companyId, java.lang.String name,
1854                    int scope, long primKeyId, long roleId, boolean viewActionId,
1855                    OrderByComparator<ResourcePermission> orderByComparator)
1856                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
1857                    return getPersistence()
1858                                       .findByC_N_S_P_R_V_PrevAndNext(resourcePermissionId,
1859                            companyId, name, scope, primKeyId, roleId, viewActionId,
1860                            orderByComparator);
1861            }
1862    
1863            /**
1864            * Returns all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = any &#63; and viewActionId = &#63;.
1865            *
1866            * <p>
1867            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1868            * </p>
1869            *
1870            * @param companyId the company ID
1871            * @param name the name
1872            * @param scope the scope
1873            * @param primKeyId the prim key ID
1874            * @param roleIds the role IDs
1875            * @param viewActionId the view action ID
1876            * @return the matching resource permissions
1877            */
1878            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1879                    java.lang.String name, int scope, long primKeyId, long[] roleIds,
1880                    boolean viewActionId) {
1881                    return getPersistence()
1882                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1883                            roleIds, viewActionId);
1884            }
1885    
1886            /**
1887            * Returns a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = any &#63; and viewActionId = &#63;.
1888            *
1889            * <p>
1890            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1891            * </p>
1892            *
1893            * @param companyId the company ID
1894            * @param name the name
1895            * @param scope the scope
1896            * @param primKeyId the prim key ID
1897            * @param roleIds the role IDs
1898            * @param viewActionId the view action ID
1899            * @param start the lower bound of the range of resource permissions
1900            * @param end the upper bound of the range of resource permissions (not inclusive)
1901            * @return the range of matching resource permissions
1902            */
1903            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1904                    java.lang.String name, int scope, long primKeyId, long[] roleIds,
1905                    boolean viewActionId, int start, int end) {
1906                    return getPersistence()
1907                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1908                            roleIds, viewActionId, start, end);
1909            }
1910    
1911            /**
1912            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = any &#63; and viewActionId = &#63;.
1913            *
1914            * <p>
1915            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1916            * </p>
1917            *
1918            * @param companyId the company ID
1919            * @param name the name
1920            * @param scope the scope
1921            * @param primKeyId the prim key ID
1922            * @param roleIds the role IDs
1923            * @param viewActionId the view action ID
1924            * @param start the lower bound of the range of resource permissions
1925            * @param end the upper bound of the range of resource permissions (not inclusive)
1926            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1927            * @return the ordered range of matching resource permissions
1928            */
1929            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1930                    java.lang.String name, int scope, long primKeyId, long[] roleIds,
1931                    boolean viewActionId, int start, int end,
1932                    OrderByComparator<ResourcePermission> orderByComparator) {
1933                    return getPersistence()
1934                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1935                            roleIds, viewActionId, start, end, orderByComparator);
1936            }
1937    
1938            /**
1939            * Returns an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;, optionally using the finder cache.
1940            *
1941            * <p>
1942            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
1943            * </p>
1944            *
1945            * @param companyId the company ID
1946            * @param name the name
1947            * @param scope the scope
1948            * @param primKeyId the prim key ID
1949            * @param roleId the role ID
1950            * @param viewActionId the view action ID
1951            * @param start the lower bound of the range of resource permissions
1952            * @param end the upper bound of the range of resource permissions (not inclusive)
1953            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1954            * @param retrieveFromCache whether to retrieve from the finder cache
1955            * @return the ordered range of matching resource permissions
1956            */
1957            public static List<ResourcePermission> findByC_N_S_P_R_V(long companyId,
1958                    java.lang.String name, int scope, long primKeyId, long[] roleIds,
1959                    boolean viewActionId, int start, int end,
1960                    OrderByComparator<ResourcePermission> orderByComparator,
1961                    boolean retrieveFromCache) {
1962                    return getPersistence()
1963                                       .findByC_N_S_P_R_V(companyId, name, scope, primKeyId,
1964                            roleIds, viewActionId, start, end, orderByComparator,
1965                            retrieveFromCache);
1966            }
1967    
1968            /**
1969            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63; from the database.
1970            *
1971            * @param companyId the company ID
1972            * @param name the name
1973            * @param scope the scope
1974            * @param primKeyId the prim key ID
1975            * @param roleId the role ID
1976            * @param viewActionId the view action ID
1977            */
1978            public static void removeByC_N_S_P_R_V(long companyId,
1979                    java.lang.String name, int scope, long primKeyId, long roleId,
1980                    boolean viewActionId) {
1981                    getPersistence()
1982                            .removeByC_N_S_P_R_V(companyId, name, scope, primKeyId, roleId,
1983                            viewActionId);
1984            }
1985    
1986            /**
1987            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = &#63; and viewActionId = &#63;.
1988            *
1989            * @param companyId the company ID
1990            * @param name the name
1991            * @param scope the scope
1992            * @param primKeyId the prim key ID
1993            * @param roleId the role ID
1994            * @param viewActionId the view action ID
1995            * @return the number of matching resource permissions
1996            */
1997            public static int countByC_N_S_P_R_V(long companyId, java.lang.String name,
1998                    int scope, long primKeyId, long roleId, boolean viewActionId) {
1999                    return getPersistence()
2000                                       .countByC_N_S_P_R_V(companyId, name, scope, primKeyId,
2001                            roleId, viewActionId);
2002            }
2003    
2004            /**
2005            * Returns the number of resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKeyId = &#63; and roleId = any &#63; and viewActionId = &#63;.
2006            *
2007            * @param companyId the company ID
2008            * @param name the name
2009            * @param scope the scope
2010            * @param primKeyId the prim key ID
2011            * @param roleIds the role IDs
2012            * @param viewActionId the view action ID
2013            * @return the number of matching resource permissions
2014            */
2015            public static int countByC_N_S_P_R_V(long companyId, java.lang.String name,
2016                    int scope, long primKeyId, long[] roleIds, boolean viewActionId) {
2017                    return getPersistence()
2018                                       .countByC_N_S_P_R_V(companyId, name, scope, primKeyId,
2019                            roleIds, viewActionId);
2020            }
2021    
2022            /**
2023            * Caches the resource permission in the entity cache if it is enabled.
2024            *
2025            * @param resourcePermission the resource permission
2026            */
2027            public static void cacheResult(ResourcePermission resourcePermission) {
2028                    getPersistence().cacheResult(resourcePermission);
2029            }
2030    
2031            /**
2032            * Caches the resource permissions in the entity cache if it is enabled.
2033            *
2034            * @param resourcePermissions the resource permissions
2035            */
2036            public static void cacheResult(List<ResourcePermission> resourcePermissions) {
2037                    getPersistence().cacheResult(resourcePermissions);
2038            }
2039    
2040            /**
2041            * Creates a new resource permission with the primary key. Does not add the resource permission to the database.
2042            *
2043            * @param resourcePermissionId the primary key for the new resource permission
2044            * @return the new resource permission
2045            */
2046            public static ResourcePermission create(long resourcePermissionId) {
2047                    return getPersistence().create(resourcePermissionId);
2048            }
2049    
2050            /**
2051            * Removes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.
2052            *
2053            * @param resourcePermissionId the primary key of the resource permission
2054            * @return the resource permission that was removed
2055            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
2056            */
2057            public static ResourcePermission remove(long resourcePermissionId)
2058                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
2059                    return getPersistence().remove(resourcePermissionId);
2060            }
2061    
2062            public static ResourcePermission updateImpl(
2063                    ResourcePermission resourcePermission) {
2064                    return getPersistence().updateImpl(resourcePermission);
2065            }
2066    
2067            /**
2068            * Returns the resource permission with the primary key or throws a {@link NoSuchResourcePermissionException} if it could not be found.
2069            *
2070            * @param resourcePermissionId the primary key of the resource permission
2071            * @return the resource permission
2072            * @throws NoSuchResourcePermissionException if a resource permission with the primary key could not be found
2073            */
2074            public static ResourcePermission findByPrimaryKey(long resourcePermissionId)
2075                    throws com.liferay.portal.kernel.exception.NoSuchResourcePermissionException {
2076                    return getPersistence().findByPrimaryKey(resourcePermissionId);
2077            }
2078    
2079            /**
2080            * Returns the resource permission with the primary key or returns <code>null</code> if it could not be found.
2081            *
2082            * @param resourcePermissionId the primary key of the resource permission
2083            * @return the resource permission, or <code>null</code> if a resource permission with the primary key could not be found
2084            */
2085            public static ResourcePermission fetchByPrimaryKey(
2086                    long resourcePermissionId) {
2087                    return getPersistence().fetchByPrimaryKey(resourcePermissionId);
2088            }
2089    
2090            public static java.util.Map<java.io.Serializable, ResourcePermission> fetchByPrimaryKeys(
2091                    java.util.Set<java.io.Serializable> primaryKeys) {
2092                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
2093            }
2094    
2095            /**
2096            * Returns all the resource permissions.
2097            *
2098            * @return the resource permissions
2099            */
2100            public static List<ResourcePermission> findAll() {
2101                    return getPersistence().findAll();
2102            }
2103    
2104            /**
2105            * Returns a range of all the resource permissions.
2106            *
2107            * <p>
2108            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
2109            * </p>
2110            *
2111            * @param start the lower bound of the range of resource permissions
2112            * @param end the upper bound of the range of resource permissions (not inclusive)
2113            * @return the range of resource permissions
2114            */
2115            public static List<ResourcePermission> findAll(int start, int end) {
2116                    return getPersistence().findAll(start, end);
2117            }
2118    
2119            /**
2120            * Returns an ordered range of all the resource permissions.
2121            *
2122            * <p>
2123            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
2124            * </p>
2125            *
2126            * @param start the lower bound of the range of resource permissions
2127            * @param end the upper bound of the range of resource permissions (not inclusive)
2128            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
2129            * @return the ordered range of resource permissions
2130            */
2131            public static List<ResourcePermission> findAll(int start, int end,
2132                    OrderByComparator<ResourcePermission> orderByComparator) {
2133                    return getPersistence().findAll(start, end, orderByComparator);
2134            }
2135    
2136            /**
2137            * Returns an ordered range of all the resource permissions.
2138            *
2139            * <p>
2140            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
2141            * </p>
2142            *
2143            * @param start the lower bound of the range of resource permissions
2144            * @param end the upper bound of the range of resource permissions (not inclusive)
2145            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
2146            * @param retrieveFromCache whether to retrieve from the finder cache
2147            * @return the ordered range of resource permissions
2148            */
2149            public static List<ResourcePermission> findAll(int start, int end,
2150                    OrderByComparator<ResourcePermission> orderByComparator,
2151                    boolean retrieveFromCache) {
2152                    return getPersistence()
2153                                       .findAll(start, end, orderByComparator, retrieveFromCache);
2154            }
2155    
2156            /**
2157            * Removes all the resource permissions from the database.
2158            */
2159            public static void removeAll() {
2160                    getPersistence().removeAll();
2161            }
2162    
2163            /**
2164            * Returns the number of resource permissions.
2165            *
2166            * @return the number of resource permissions
2167            */
2168            public static int countAll() {
2169                    return getPersistence().countAll();
2170            }
2171    
2172            public static ResourcePermissionPersistence getPersistence() {
2173                    if (_persistence == null) {
2174                            _persistence = (ResourcePermissionPersistence)PortalBeanLocatorUtil.locate(ResourcePermissionPersistence.class.getName());
2175    
2176                            ReferenceRegistry.registerReference(ResourcePermissionUtil.class,
2177                                    "_persistence");
2178                    }
2179    
2180                    return _persistence;
2181            }
2182    
2183            private static ResourcePermissionPersistence _persistence;
2184    }