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