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