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