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