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.ResourceTypePermission;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the resource type permission service. This utility wraps {@link ResourceTypePermissionPersistenceImpl} 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 ResourceTypePermissionPersistence
037     * @see ResourceTypePermissionPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class ResourceTypePermissionUtil {
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(ResourceTypePermission resourceTypePermission) {
059                    getPersistence().clearCache(resourceTypePermission);
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<ResourceTypePermission> 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<ResourceTypePermission> 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<ResourceTypePermission> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator<ResourceTypePermission> 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 ResourceTypePermission update(
100                    ResourceTypePermission resourceTypePermission) {
101                    return getPersistence().update(resourceTypePermission);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static ResourceTypePermission update(
108                    ResourceTypePermission resourceTypePermission,
109                    ServiceContext serviceContext) {
110                    return getPersistence().update(resourceTypePermission, serviceContext);
111            }
112    
113            /**
114            * Returns all the resource type permissions where roleId = &#63;.
115            *
116            * @param roleId the role ID
117            * @return the matching resource type permissions
118            */
119            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId(
120                    long roleId) {
121                    return getPersistence().findByRoleId(roleId);
122            }
123    
124            /**
125            * Returns a range of all the resource type permissions where roleId = &#63;.
126            *
127            * <p>
128            * 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.ResourceTypePermissionModelImpl}. 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.
129            * </p>
130            *
131            * @param roleId the role ID
132            * @param start the lower bound of the range of resource type permissions
133            * @param end the upper bound of the range of resource type permissions (not inclusive)
134            * @return the range of matching resource type permissions
135            */
136            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId(
137                    long roleId, int start, int end) {
138                    return getPersistence().findByRoleId(roleId, start, end);
139            }
140    
141            /**
142            * Returns an ordered range of all the resource type permissions where roleId = &#63;.
143            *
144            * <p>
145            * 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.ResourceTypePermissionModelImpl}. 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.
146            * </p>
147            *
148            * @param roleId the role ID
149            * @param start the lower bound of the range of resource type permissions
150            * @param end the upper bound of the range of resource type permissions (not inclusive)
151            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
152            * @return the ordered range of matching resource type permissions
153            */
154            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId(
155                    long roleId, int start, int end,
156                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator) {
157                    return getPersistence()
158                                       .findByRoleId(roleId, start, end, orderByComparator);
159            }
160    
161            /**
162            * Returns the first resource type permission in the ordered set where roleId = &#63;.
163            *
164            * @param roleId the role ID
165            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
166            * @return the first matching resource type permission
167            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
168            */
169            public static com.liferay.portal.model.ResourceTypePermission findByRoleId_First(
170                    long roleId,
171                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator)
172                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
173                    return getPersistence().findByRoleId_First(roleId, orderByComparator);
174            }
175    
176            /**
177            * Returns the first resource type permission in the ordered set where roleId = &#63;.
178            *
179            * @param roleId the role ID
180            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
181            * @return the first matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
182            */
183            public static com.liferay.portal.model.ResourceTypePermission fetchByRoleId_First(
184                    long roleId,
185                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator) {
186                    return getPersistence().fetchByRoleId_First(roleId, orderByComparator);
187            }
188    
189            /**
190            * Returns the last resource type permission in the ordered set where roleId = &#63;.
191            *
192            * @param roleId the role ID
193            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
194            * @return the last matching resource type permission
195            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
196            */
197            public static com.liferay.portal.model.ResourceTypePermission findByRoleId_Last(
198                    long roleId,
199                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator)
200                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
201                    return getPersistence().findByRoleId_Last(roleId, orderByComparator);
202            }
203    
204            /**
205            * Returns the last resource type permission in the ordered set where roleId = &#63;.
206            *
207            * @param roleId the role ID
208            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
209            * @return the last matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
210            */
211            public static com.liferay.portal.model.ResourceTypePermission fetchByRoleId_Last(
212                    long roleId,
213                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator) {
214                    return getPersistence().fetchByRoleId_Last(roleId, orderByComparator);
215            }
216    
217            /**
218            * Returns the resource type permissions before and after the current resource type permission in the ordered set where roleId = &#63;.
219            *
220            * @param resourceTypePermissionId the primary key of the current resource type permission
221            * @param roleId the role ID
222            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
223            * @return the previous, current, and next resource type permission
224            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
225            */
226            public static com.liferay.portal.model.ResourceTypePermission[] findByRoleId_PrevAndNext(
227                    long resourceTypePermissionId, long roleId,
228                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator)
229                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
230                    return getPersistence()
231                                       .findByRoleId_PrevAndNext(resourceTypePermissionId, roleId,
232                            orderByComparator);
233            }
234    
235            /**
236            * Removes all the resource type permissions where roleId = &#63; from the database.
237            *
238            * @param roleId the role ID
239            */
240            public static void removeByRoleId(long roleId) {
241                    getPersistence().removeByRoleId(roleId);
242            }
243    
244            /**
245            * Returns the number of resource type permissions where roleId = &#63;.
246            *
247            * @param roleId the role ID
248            * @return the number of matching resource type permissions
249            */
250            public static int countByRoleId(long roleId) {
251                    return getPersistence().countByRoleId(roleId);
252            }
253    
254            /**
255            * Returns all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
256            *
257            * @param companyId the company ID
258            * @param name the name
259            * @param roleId the role ID
260            * @return the matching resource type permissions
261            */
262            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R(
263                    long companyId, java.lang.String name, long roleId) {
264                    return getPersistence().findByC_N_R(companyId, name, roleId);
265            }
266    
267            /**
268            * Returns a range of all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
269            *
270            * <p>
271            * 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.ResourceTypePermissionModelImpl}. 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.
272            * </p>
273            *
274            * @param companyId the company ID
275            * @param name the name
276            * @param roleId the role ID
277            * @param start the lower bound of the range of resource type permissions
278            * @param end the upper bound of the range of resource type permissions (not inclusive)
279            * @return the range of matching resource type permissions
280            */
281            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R(
282                    long companyId, java.lang.String name, long roleId, int start, int end) {
283                    return getPersistence().findByC_N_R(companyId, name, roleId, start, end);
284            }
285    
286            /**
287            * Returns an ordered range of all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
288            *
289            * <p>
290            * 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.ResourceTypePermissionModelImpl}. 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.
291            * </p>
292            *
293            * @param companyId the company ID
294            * @param name the name
295            * @param roleId the role ID
296            * @param start the lower bound of the range of resource type permissions
297            * @param end the upper bound of the range of resource type permissions (not inclusive)
298            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
299            * @return the ordered range of matching resource type permissions
300            */
301            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R(
302                    long companyId, java.lang.String name, long roleId, int start, int end,
303                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator) {
304                    return getPersistence()
305                                       .findByC_N_R(companyId, name, roleId, start, end,
306                            orderByComparator);
307            }
308    
309            /**
310            * Returns the first resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
311            *
312            * @param companyId the company ID
313            * @param name the name
314            * @param roleId the role ID
315            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
316            * @return the first matching resource type permission
317            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
318            */
319            public static com.liferay.portal.model.ResourceTypePermission findByC_N_R_First(
320                    long companyId, java.lang.String name, long roleId,
321                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator)
322                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
323                    return getPersistence()
324                                       .findByC_N_R_First(companyId, name, roleId, orderByComparator);
325            }
326    
327            /**
328            * Returns the first resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
329            *
330            * @param companyId the company ID
331            * @param name the name
332            * @param roleId the role ID
333            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
334            * @return the first matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
335            */
336            public static com.liferay.portal.model.ResourceTypePermission fetchByC_N_R_First(
337                    long companyId, java.lang.String name, long roleId,
338                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator) {
339                    return getPersistence()
340                                       .fetchByC_N_R_First(companyId, name, roleId,
341                            orderByComparator);
342            }
343    
344            /**
345            * Returns the last resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
346            *
347            * @param companyId the company ID
348            * @param name the name
349            * @param roleId the role ID
350            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
351            * @return the last matching resource type permission
352            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
353            */
354            public static com.liferay.portal.model.ResourceTypePermission findByC_N_R_Last(
355                    long companyId, java.lang.String name, long roleId,
356                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator)
357                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
358                    return getPersistence()
359                                       .findByC_N_R_Last(companyId, name, roleId, orderByComparator);
360            }
361    
362            /**
363            * Returns the last resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
364            *
365            * @param companyId the company ID
366            * @param name the name
367            * @param roleId the role ID
368            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
369            * @return the last matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
370            */
371            public static com.liferay.portal.model.ResourceTypePermission fetchByC_N_R_Last(
372                    long companyId, java.lang.String name, long roleId,
373                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator) {
374                    return getPersistence()
375                                       .fetchByC_N_R_Last(companyId, name, roleId, orderByComparator);
376            }
377    
378            /**
379            * Returns the resource type permissions before and after the current resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
380            *
381            * @param resourceTypePermissionId the primary key of the current resource type permission
382            * @param companyId the company ID
383            * @param name the name
384            * @param roleId the role ID
385            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
386            * @return the previous, current, and next resource type permission
387            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
388            */
389            public static com.liferay.portal.model.ResourceTypePermission[] findByC_N_R_PrevAndNext(
390                    long resourceTypePermissionId, long companyId, java.lang.String name,
391                    long roleId,
392                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator)
393                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
394                    return getPersistence()
395                                       .findByC_N_R_PrevAndNext(resourceTypePermissionId,
396                            companyId, name, roleId, orderByComparator);
397            }
398    
399            /**
400            * Removes all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63; from the database.
401            *
402            * @param companyId the company ID
403            * @param name the name
404            * @param roleId the role ID
405            */
406            public static void removeByC_N_R(long companyId, java.lang.String name,
407                    long roleId) {
408                    getPersistence().removeByC_N_R(companyId, name, roleId);
409            }
410    
411            /**
412            * Returns the number of resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
413            *
414            * @param companyId the company ID
415            * @param name the name
416            * @param roleId the role ID
417            * @return the number of matching resource type permissions
418            */
419            public static int countByC_N_R(long companyId, java.lang.String name,
420                    long roleId) {
421                    return getPersistence().countByC_N_R(companyId, name, roleId);
422            }
423    
424            /**
425            * Returns the resource type permission where companyId = &#63; and groupId = &#63; and name = &#63; and roleId = &#63; or throws a {@link com.liferay.portal.NoSuchResourceTypePermissionException} if it could not be found.
426            *
427            * @param companyId the company ID
428            * @param groupId the group ID
429            * @param name the name
430            * @param roleId the role ID
431            * @return the matching resource type permission
432            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
433            */
434            public static com.liferay.portal.model.ResourceTypePermission findByC_G_N_R(
435                    long companyId, long groupId, java.lang.String name, long roleId)
436                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
437                    return getPersistence().findByC_G_N_R(companyId, groupId, name, roleId);
438            }
439    
440            /**
441            * Returns the resource type permission where companyId = &#63; and groupId = &#63; and name = &#63; and roleId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
442            *
443            * @param companyId the company ID
444            * @param groupId the group ID
445            * @param name the name
446            * @param roleId the role ID
447            * @return the matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
448            */
449            public static com.liferay.portal.model.ResourceTypePermission fetchByC_G_N_R(
450                    long companyId, long groupId, java.lang.String name, long roleId) {
451                    return getPersistence().fetchByC_G_N_R(companyId, groupId, name, roleId);
452            }
453    
454            /**
455            * Returns the resource type permission where companyId = &#63; and groupId = &#63; and name = &#63; and roleId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
456            *
457            * @param companyId the company ID
458            * @param groupId the group ID
459            * @param name the name
460            * @param roleId the role ID
461            * @param retrieveFromCache whether to use the finder cache
462            * @return the matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
463            */
464            public static com.liferay.portal.model.ResourceTypePermission fetchByC_G_N_R(
465                    long companyId, long groupId, java.lang.String name, long roleId,
466                    boolean retrieveFromCache) {
467                    return getPersistence()
468                                       .fetchByC_G_N_R(companyId, groupId, name, roleId,
469                            retrieveFromCache);
470            }
471    
472            /**
473            * Removes the resource type permission where companyId = &#63; and groupId = &#63; and name = &#63; and roleId = &#63; from the database.
474            *
475            * @param companyId the company ID
476            * @param groupId the group ID
477            * @param name the name
478            * @param roleId the role ID
479            * @return the resource type permission that was removed
480            */
481            public static com.liferay.portal.model.ResourceTypePermission removeByC_G_N_R(
482                    long companyId, long groupId, java.lang.String name, long roleId)
483                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
484                    return getPersistence().removeByC_G_N_R(companyId, groupId, name, roleId);
485            }
486    
487            /**
488            * Returns the number of resource type permissions where companyId = &#63; and groupId = &#63; and name = &#63; and roleId = &#63;.
489            *
490            * @param companyId the company ID
491            * @param groupId the group ID
492            * @param name the name
493            * @param roleId the role ID
494            * @return the number of matching resource type permissions
495            */
496            public static int countByC_G_N_R(long companyId, long groupId,
497                    java.lang.String name, long roleId) {
498                    return getPersistence().countByC_G_N_R(companyId, groupId, name, roleId);
499            }
500    
501            /**
502            * Caches the resource type permission in the entity cache if it is enabled.
503            *
504            * @param resourceTypePermission the resource type permission
505            */
506            public static void cacheResult(
507                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
508                    getPersistence().cacheResult(resourceTypePermission);
509            }
510    
511            /**
512            * Caches the resource type permissions in the entity cache if it is enabled.
513            *
514            * @param resourceTypePermissions the resource type permissions
515            */
516            public static void cacheResult(
517                    java.util.List<com.liferay.portal.model.ResourceTypePermission> resourceTypePermissions) {
518                    getPersistence().cacheResult(resourceTypePermissions);
519            }
520    
521            /**
522            * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database.
523            *
524            * @param resourceTypePermissionId the primary key for the new resource type permission
525            * @return the new resource type permission
526            */
527            public static com.liferay.portal.model.ResourceTypePermission create(
528                    long resourceTypePermissionId) {
529                    return getPersistence().create(resourceTypePermissionId);
530            }
531    
532            /**
533            * Removes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners.
534            *
535            * @param resourceTypePermissionId the primary key of the resource type permission
536            * @return the resource type permission that was removed
537            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
538            */
539            public static com.liferay.portal.model.ResourceTypePermission remove(
540                    long resourceTypePermissionId)
541                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
542                    return getPersistence().remove(resourceTypePermissionId);
543            }
544    
545            public static com.liferay.portal.model.ResourceTypePermission updateImpl(
546                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
547                    return getPersistence().updateImpl(resourceTypePermission);
548            }
549    
550            /**
551            * Returns the resource type permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourceTypePermissionException} if it could not be found.
552            *
553            * @param resourceTypePermissionId the primary key of the resource type permission
554            * @return the resource type permission
555            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
556            */
557            public static com.liferay.portal.model.ResourceTypePermission findByPrimaryKey(
558                    long resourceTypePermissionId)
559                    throws com.liferay.portal.NoSuchResourceTypePermissionException {
560                    return getPersistence().findByPrimaryKey(resourceTypePermissionId);
561            }
562    
563            /**
564            * Returns the resource type permission with the primary key or returns <code>null</code> if it could not be found.
565            *
566            * @param resourceTypePermissionId the primary key of the resource type permission
567            * @return the resource type permission, or <code>null</code> if a resource type permission with the primary key could not be found
568            */
569            public static com.liferay.portal.model.ResourceTypePermission fetchByPrimaryKey(
570                    long resourceTypePermissionId) {
571                    return getPersistence().fetchByPrimaryKey(resourceTypePermissionId);
572            }
573    
574            public static java.util.Map<java.io.Serializable, com.liferay.portal.model.ResourceTypePermission> fetchByPrimaryKeys(
575                    java.util.Set<java.io.Serializable> primaryKeys) {
576                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
577            }
578    
579            /**
580            * Returns all the resource type permissions.
581            *
582            * @return the resource type permissions
583            */
584            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll() {
585                    return getPersistence().findAll();
586            }
587    
588            /**
589            * Returns a range of all the resource type permissions.
590            *
591            * <p>
592            * 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.ResourceTypePermissionModelImpl}. 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.
593            * </p>
594            *
595            * @param start the lower bound of the range of resource type permissions
596            * @param end the upper bound of the range of resource type permissions (not inclusive)
597            * @return the range of resource type permissions
598            */
599            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll(
600                    int start, int end) {
601                    return getPersistence().findAll(start, end);
602            }
603    
604            /**
605            * Returns an ordered range of all the resource type permissions.
606            *
607            * <p>
608            * 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.ResourceTypePermissionModelImpl}. 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.
609            * </p>
610            *
611            * @param start the lower bound of the range of resource type permissions
612            * @param end the upper bound of the range of resource type permissions (not inclusive)
613            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
614            * @return the ordered range of resource type permissions
615            */
616            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll(
617                    int start, int end,
618                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ResourceTypePermission> orderByComparator) {
619                    return getPersistence().findAll(start, end, orderByComparator);
620            }
621    
622            /**
623            * Removes all the resource type permissions from the database.
624            */
625            public static void removeAll() {
626                    getPersistence().removeAll();
627            }
628    
629            /**
630            * Returns the number of resource type permissions.
631            *
632            * @return the number of resource type permissions
633            */
634            public static int countAll() {
635                    return getPersistence().countAll();
636            }
637    
638            public static ResourceTypePermissionPersistence getPersistence() {
639                    if (_persistence == null) {
640                            _persistence = (ResourceTypePermissionPersistence)PortalBeanLocatorUtil.locate(ResourceTypePermissionPersistence.class.getName());
641    
642                            ReferenceRegistry.registerReference(ResourceTypePermissionUtil.class,
643                                    "_persistence");
644                    }
645    
646                    return _persistence;
647            }
648    
649            /**
650             * @deprecated As of 6.2.0
651             */
652            @Deprecated
653            public void setPersistence(ResourceTypePermissionPersistence persistence) {
654            }
655    
656            private static ResourceTypePermissionPersistence _persistence;
657    }