001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.ResourceTypePermission;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * 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.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ResourceTypePermissionPersistence
036     * @see ResourceTypePermissionPersistenceImpl
037     * @generated
038     */
039    public class ResourceTypePermissionUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(ResourceTypePermission resourceTypePermission) {
057                    getPersistence().clearCache(resourceTypePermission);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<ResourceTypePermission> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<ResourceTypePermission> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<ResourceTypePermission> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
098             */
099            public static ResourceTypePermission update(
100                    ResourceTypePermission resourceTypePermission)
101                    throws SystemException {
102                    return getPersistence().update(resourceTypePermission);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static ResourceTypePermission update(
109                    ResourceTypePermission resourceTypePermission,
110                    ServiceContext serviceContext) throws SystemException {
111                    return getPersistence().update(resourceTypePermission, serviceContext);
112            }
113    
114            /**
115            * Caches the resource type permission in the entity cache if it is enabled.
116            *
117            * @param resourceTypePermission the resource type permission
118            */
119            public static void cacheResult(
120                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
121                    getPersistence().cacheResult(resourceTypePermission);
122            }
123    
124            /**
125            * Caches the resource type permissions in the entity cache if it is enabled.
126            *
127            * @param resourceTypePermissions the resource type permissions
128            */
129            public static void cacheResult(
130                    java.util.List<com.liferay.portal.model.ResourceTypePermission> resourceTypePermissions) {
131                    getPersistence().cacheResult(resourceTypePermissions);
132            }
133    
134            /**
135            * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database.
136            *
137            * @param resourceTypePermissionId the primary key for the new resource type permission
138            * @return the new resource type permission
139            */
140            public static com.liferay.portal.model.ResourceTypePermission create(
141                    long resourceTypePermissionId) {
142                    return getPersistence().create(resourceTypePermissionId);
143            }
144    
145            /**
146            * Removes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners.
147            *
148            * @param resourceTypePermissionId the primary key of the resource type permission
149            * @return the resource type permission that was removed
150            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            public static com.liferay.portal.model.ResourceTypePermission remove(
154                    long resourceTypePermissionId)
155                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
156                            com.liferay.portal.kernel.exception.SystemException {
157                    return getPersistence().remove(resourceTypePermissionId);
158            }
159    
160            public static com.liferay.portal.model.ResourceTypePermission updateImpl(
161                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence().updateImpl(resourceTypePermission);
164            }
165    
166            /**
167            * Returns the resource type permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourceTypePermissionException} if it could not be found.
168            *
169            * @param resourceTypePermissionId the primary key of the resource type permission
170            * @return the resource type permission
171            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portal.model.ResourceTypePermission findByPrimaryKey(
175                    long resourceTypePermissionId)
176                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
177                            com.liferay.portal.kernel.exception.SystemException {
178                    return getPersistence().findByPrimaryKey(resourceTypePermissionId);
179            }
180    
181            /**
182            * Returns the resource type permission with the primary key or returns <code>null</code> if it could not be found.
183            *
184            * @param resourceTypePermissionId the primary key of the resource type permission
185            * @return the resource type permission, or <code>null</code> if a resource type permission with the primary key could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public static com.liferay.portal.model.ResourceTypePermission fetchByPrimaryKey(
189                    long resourceTypePermissionId)
190                    throws com.liferay.portal.kernel.exception.SystemException {
191                    return getPersistence().fetchByPrimaryKey(resourceTypePermissionId);
192            }
193    
194            /**
195            * Returns all the resource type permissions where roleId = &#63;.
196            *
197            * @param roleId the role ID
198            * @return the matching resource type permissions
199            * @throws SystemException if a system exception occurred
200            */
201            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId(
202                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByRoleId(roleId);
204            }
205    
206            /**
207            * Returns a range of all the resource type permissions where roleId = &#63;.
208            *
209            * <p>
210            * 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.
211            * </p>
212            *
213            * @param roleId the role ID
214            * @param start the lower bound of the range of resource type permissions
215            * @param end the upper bound of the range of resource type permissions (not inclusive)
216            * @return the range of matching resource type permissions
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId(
220                    long roleId, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByRoleId(roleId, start, end);
223            }
224    
225            /**
226            * Returns an ordered range of all the resource type permissions where roleId = &#63;.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param roleId the role ID
233            * @param start the lower bound of the range of resource type permissions
234            * @param end the upper bound of the range of resource type permissions (not inclusive)
235            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
236            * @return the ordered range of matching resource type permissions
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId(
240                    long roleId, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence()
244                                       .findByRoleId(roleId, start, end, orderByComparator);
245            }
246    
247            /**
248            * Returns the first resource type permission in the ordered set where roleId = &#63;.
249            *
250            * @param roleId the role ID
251            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
252            * @return the first matching resource type permission
253            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
254            * @throws SystemException if a system exception occurred
255            */
256            public static com.liferay.portal.model.ResourceTypePermission findByRoleId_First(
257                    long roleId,
258                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
259                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
260                            com.liferay.portal.kernel.exception.SystemException {
261                    return getPersistence().findByRoleId_First(roleId, orderByComparator);
262            }
263    
264            /**
265            * Returns the first resource type permission in the ordered set where roleId = &#63;.
266            *
267            * @param roleId the role ID
268            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
269            * @return the first matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
270            * @throws SystemException if a system exception occurred
271            */
272            public static com.liferay.portal.model.ResourceTypePermission fetchByRoleId_First(
273                    long roleId,
274                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
275                    throws com.liferay.portal.kernel.exception.SystemException {
276                    return getPersistence().fetchByRoleId_First(roleId, orderByComparator);
277            }
278    
279            /**
280            * Returns the last resource type permission in the ordered set where roleId = &#63;.
281            *
282            * @param roleId the role ID
283            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
284            * @return the last matching resource type permission
285            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
286            * @throws SystemException if a system exception occurred
287            */
288            public static com.liferay.portal.model.ResourceTypePermission findByRoleId_Last(
289                    long roleId,
290                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
291                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
292                            com.liferay.portal.kernel.exception.SystemException {
293                    return getPersistence().findByRoleId_Last(roleId, orderByComparator);
294            }
295    
296            /**
297            * Returns the last resource type permission in the ordered set where roleId = &#63;.
298            *
299            * @param roleId the role ID
300            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
301            * @return the last matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
302            * @throws SystemException if a system exception occurred
303            */
304            public static com.liferay.portal.model.ResourceTypePermission fetchByRoleId_Last(
305                    long roleId,
306                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
307                    throws com.liferay.portal.kernel.exception.SystemException {
308                    return getPersistence().fetchByRoleId_Last(roleId, orderByComparator);
309            }
310    
311            /**
312            * Returns the resource type permissions before and after the current resource type permission in the ordered set where roleId = &#63;.
313            *
314            * @param resourceTypePermissionId the primary key of the current resource type permission
315            * @param roleId the role ID
316            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
317            * @return the previous, current, and next resource type permission
318            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
319            * @throws SystemException if a system exception occurred
320            */
321            public static com.liferay.portal.model.ResourceTypePermission[] findByRoleId_PrevAndNext(
322                    long resourceTypePermissionId, long roleId,
323                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
324                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
325                            com.liferay.portal.kernel.exception.SystemException {
326                    return getPersistence()
327                                       .findByRoleId_PrevAndNext(resourceTypePermissionId, roleId,
328                            orderByComparator);
329            }
330    
331            /**
332            * Returns all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
333            *
334            * @param companyId the company ID
335            * @param name the name
336            * @param roleId the role ID
337            * @return the matching resource type permissions
338            * @throws SystemException if a system exception occurred
339            */
340            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R(
341                    long companyId, java.lang.String name, long roleId)
342                    throws com.liferay.portal.kernel.exception.SystemException {
343                    return getPersistence().findByC_N_R(companyId, name, roleId);
344            }
345    
346            /**
347            * Returns a range of all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
348            *
349            * <p>
350            * 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.
351            * </p>
352            *
353            * @param companyId the company ID
354            * @param name the name
355            * @param roleId the role ID
356            * @param start the lower bound of the range of resource type permissions
357            * @param end the upper bound of the range of resource type permissions (not inclusive)
358            * @return the range of matching resource type permissions
359            * @throws SystemException if a system exception occurred
360            */
361            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R(
362                    long companyId, java.lang.String name, long roleId, int start, int end)
363                    throws com.liferay.portal.kernel.exception.SystemException {
364                    return getPersistence().findByC_N_R(companyId, name, roleId, start, end);
365            }
366    
367            /**
368            * Returns an ordered range of all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
369            *
370            * <p>
371            * 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.
372            * </p>
373            *
374            * @param companyId the company ID
375            * @param name the name
376            * @param roleId the role ID
377            * @param start the lower bound of the range of resource type permissions
378            * @param end the upper bound of the range of resource type permissions (not inclusive)
379            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
380            * @return the ordered range of matching resource type permissions
381            * @throws SystemException if a system exception occurred
382            */
383            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R(
384                    long companyId, java.lang.String name, long roleId, int start, int end,
385                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
386                    throws com.liferay.portal.kernel.exception.SystemException {
387                    return getPersistence()
388                                       .findByC_N_R(companyId, name, roleId, start, end,
389                            orderByComparator);
390            }
391    
392            /**
393            * Returns the first resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
394            *
395            * @param companyId the company ID
396            * @param name the name
397            * @param roleId the role ID
398            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
399            * @return the first matching resource type permission
400            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
401            * @throws SystemException if a system exception occurred
402            */
403            public static com.liferay.portal.model.ResourceTypePermission findByC_N_R_First(
404                    long companyId, java.lang.String name, long roleId,
405                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
406                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
407                            com.liferay.portal.kernel.exception.SystemException {
408                    return getPersistence()
409                                       .findByC_N_R_First(companyId, name, roleId, orderByComparator);
410            }
411    
412            /**
413            * Returns the first resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
414            *
415            * @param companyId the company ID
416            * @param name the name
417            * @param roleId the role ID
418            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
419            * @return the first matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
420            * @throws SystemException if a system exception occurred
421            */
422            public static com.liferay.portal.model.ResourceTypePermission fetchByC_N_R_First(
423                    long companyId, java.lang.String name, long roleId,
424                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
425                    throws com.liferay.portal.kernel.exception.SystemException {
426                    return getPersistence()
427                                       .fetchByC_N_R_First(companyId, name, roleId,
428                            orderByComparator);
429            }
430    
431            /**
432            * Returns the last resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
433            *
434            * @param companyId the company ID
435            * @param name the name
436            * @param roleId the role ID
437            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
438            * @return the last matching resource type permission
439            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
440            * @throws SystemException if a system exception occurred
441            */
442            public static com.liferay.portal.model.ResourceTypePermission findByC_N_R_Last(
443                    long companyId, java.lang.String name, long roleId,
444                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
445                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
446                            com.liferay.portal.kernel.exception.SystemException {
447                    return getPersistence()
448                                       .findByC_N_R_Last(companyId, name, roleId, orderByComparator);
449            }
450    
451            /**
452            * Returns the last resource type permission in the ordered set where companyId = &#63; and name = &#63; and roleId = &#63;.
453            *
454            * @param companyId the company ID
455            * @param name the name
456            * @param roleId the role ID
457            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
458            * @return the last matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
459            * @throws SystemException if a system exception occurred
460            */
461            public static com.liferay.portal.model.ResourceTypePermission fetchByC_N_R_Last(
462                    long companyId, java.lang.String name, long roleId,
463                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
464                    throws com.liferay.portal.kernel.exception.SystemException {
465                    return getPersistence()
466                                       .fetchByC_N_R_Last(companyId, name, roleId, orderByComparator);
467            }
468    
469            /**
470            * 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;.
471            *
472            * @param resourceTypePermissionId the primary key of the current resource type permission
473            * @param companyId the company ID
474            * @param name the name
475            * @param roleId the role ID
476            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
477            * @return the previous, current, and next resource type permission
478            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found
479            * @throws SystemException if a system exception occurred
480            */
481            public static com.liferay.portal.model.ResourceTypePermission[] findByC_N_R_PrevAndNext(
482                    long resourceTypePermissionId, long companyId, java.lang.String name,
483                    long roleId,
484                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
485                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
486                            com.liferay.portal.kernel.exception.SystemException {
487                    return getPersistence()
488                                       .findByC_N_R_PrevAndNext(resourceTypePermissionId,
489                            companyId, name, roleId, orderByComparator);
490            }
491    
492            /**
493            * 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.
494            *
495            * @param companyId the company ID
496            * @param groupId the group ID
497            * @param name the name
498            * @param roleId the role ID
499            * @return the matching resource type permission
500            * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found
501            * @throws SystemException if a system exception occurred
502            */
503            public static com.liferay.portal.model.ResourceTypePermission findByC_G_N_R(
504                    long companyId, long groupId, java.lang.String name, long roleId)
505                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
506                            com.liferay.portal.kernel.exception.SystemException {
507                    return getPersistence().findByC_G_N_R(companyId, groupId, name, roleId);
508            }
509    
510            /**
511            * 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.
512            *
513            * @param companyId the company ID
514            * @param groupId the group ID
515            * @param name the name
516            * @param roleId the role ID
517            * @return the matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
518            * @throws SystemException if a system exception occurred
519            */
520            public static com.liferay.portal.model.ResourceTypePermission fetchByC_G_N_R(
521                    long companyId, long groupId, java.lang.String name, long roleId)
522                    throws com.liferay.portal.kernel.exception.SystemException {
523                    return getPersistence().fetchByC_G_N_R(companyId, groupId, name, roleId);
524            }
525    
526            /**
527            * 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.
528            *
529            * @param companyId the company ID
530            * @param groupId the group ID
531            * @param name the name
532            * @param roleId the role ID
533            * @param retrieveFromCache whether to use the finder cache
534            * @return the matching resource type permission, or <code>null</code> if a matching resource type permission could not be found
535            * @throws SystemException if a system exception occurred
536            */
537            public static com.liferay.portal.model.ResourceTypePermission fetchByC_G_N_R(
538                    long companyId, long groupId, java.lang.String name, long roleId,
539                    boolean retrieveFromCache)
540                    throws com.liferay.portal.kernel.exception.SystemException {
541                    return getPersistence()
542                                       .fetchByC_G_N_R(companyId, groupId, name, roleId,
543                            retrieveFromCache);
544            }
545    
546            /**
547            * Returns all the resource type permissions.
548            *
549            * @return the resource type permissions
550            * @throws SystemException if a system exception occurred
551            */
552            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll()
553                    throws com.liferay.portal.kernel.exception.SystemException {
554                    return getPersistence().findAll();
555            }
556    
557            /**
558            * Returns a range of all the resource type permissions.
559            *
560            * <p>
561            * 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.
562            * </p>
563            *
564            * @param start the lower bound of the range of resource type permissions
565            * @param end the upper bound of the range of resource type permissions (not inclusive)
566            * @return the range of resource type permissions
567            * @throws SystemException if a system exception occurred
568            */
569            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll(
570                    int start, int end)
571                    throws com.liferay.portal.kernel.exception.SystemException {
572                    return getPersistence().findAll(start, end);
573            }
574    
575            /**
576            * Returns an ordered range of all the resource type permissions.
577            *
578            * <p>
579            * 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.
580            * </p>
581            *
582            * @param start the lower bound of the range of resource type permissions
583            * @param end the upper bound of the range of resource type permissions (not inclusive)
584            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
585            * @return the ordered range of resource type permissions
586            * @throws SystemException if a system exception occurred
587            */
588            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll(
589                    int start, int end,
590                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
591                    throws com.liferay.portal.kernel.exception.SystemException {
592                    return getPersistence().findAll(start, end, orderByComparator);
593            }
594    
595            /**
596            * Removes all the resource type permissions where roleId = &#63; from the database.
597            *
598            * @param roleId the role ID
599            * @throws SystemException if a system exception occurred
600            */
601            public static void removeByRoleId(long roleId)
602                    throws com.liferay.portal.kernel.exception.SystemException {
603                    getPersistence().removeByRoleId(roleId);
604            }
605    
606            /**
607            * Removes all the resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63; from the database.
608            *
609            * @param companyId the company ID
610            * @param name the name
611            * @param roleId the role ID
612            * @throws SystemException if a system exception occurred
613            */
614            public static void removeByC_N_R(long companyId, java.lang.String name,
615                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
616                    getPersistence().removeByC_N_R(companyId, name, roleId);
617            }
618    
619            /**
620            * Removes the resource type permission where companyId = &#63; and groupId = &#63; and name = &#63; and roleId = &#63; from the database.
621            *
622            * @param companyId the company ID
623            * @param groupId the group ID
624            * @param name the name
625            * @param roleId the role ID
626            * @return the resource type permission that was removed
627            * @throws SystemException if a system exception occurred
628            */
629            public static com.liferay.portal.model.ResourceTypePermission removeByC_G_N_R(
630                    long companyId, long groupId, java.lang.String name, long roleId)
631                    throws com.liferay.portal.NoSuchResourceTypePermissionException,
632                            com.liferay.portal.kernel.exception.SystemException {
633                    return getPersistence().removeByC_G_N_R(companyId, groupId, name, roleId);
634            }
635    
636            /**
637            * Removes all the resource type permissions from the database.
638            *
639            * @throws SystemException if a system exception occurred
640            */
641            public static void removeAll()
642                    throws com.liferay.portal.kernel.exception.SystemException {
643                    getPersistence().removeAll();
644            }
645    
646            /**
647            * Returns the number of resource type permissions where roleId = &#63;.
648            *
649            * @param roleId the role ID
650            * @return the number of matching resource type permissions
651            * @throws SystemException if a system exception occurred
652            */
653            public static int countByRoleId(long roleId)
654                    throws com.liferay.portal.kernel.exception.SystemException {
655                    return getPersistence().countByRoleId(roleId);
656            }
657    
658            /**
659            * Returns the number of resource type permissions where companyId = &#63; and name = &#63; and roleId = &#63;.
660            *
661            * @param companyId the company ID
662            * @param name the name
663            * @param roleId the role ID
664            * @return the number of matching resource type permissions
665            * @throws SystemException if a system exception occurred
666            */
667            public static int countByC_N_R(long companyId, java.lang.String name,
668                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
669                    return getPersistence().countByC_N_R(companyId, name, roleId);
670            }
671    
672            /**
673            * Returns the number of resource type permissions where companyId = &#63; and groupId = &#63; and name = &#63; and roleId = &#63;.
674            *
675            * @param companyId the company ID
676            * @param groupId the group ID
677            * @param name the name
678            * @param roleId the role ID
679            * @return the number of matching resource type permissions
680            * @throws SystemException if a system exception occurred
681            */
682            public static int countByC_G_N_R(long companyId, long groupId,
683                    java.lang.String name, long roleId)
684                    throws com.liferay.portal.kernel.exception.SystemException {
685                    return getPersistence().countByC_G_N_R(companyId, groupId, name, roleId);
686            }
687    
688            /**
689            * Returns the number of resource type permissions.
690            *
691            * @return the number of resource type permissions
692            * @throws SystemException if a system exception occurred
693            */
694            public static int countAll()
695                    throws com.liferay.portal.kernel.exception.SystemException {
696                    return getPersistence().countAll();
697            }
698    
699            public static ResourceTypePermissionPersistence getPersistence() {
700                    if (_persistence == null) {
701                            _persistence = (ResourceTypePermissionPersistence)PortalBeanLocatorUtil.locate(ResourceTypePermissionPersistence.class.getName());
702    
703                            ReferenceRegistry.registerReference(ResourceTypePermissionUtil.class,
704                                    "_persistence");
705                    }
706    
707                    return _persistence;
708            }
709    
710            /**
711             * @deprecated
712             */
713            public void setPersistence(ResourceTypePermissionPersistence persistence) {
714            }
715    
716            private static ResourceTypePermissionPersistence _persistence;
717    }