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