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