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.ResourceBlockPermission;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * 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.
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 ResourceBlockPermissionPersistence
036     * @see ResourceBlockPermissionPersistenceImpl
037     * @generated
038     */
039    public class ResourceBlockPermissionUtil {
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(
057                    ResourceBlockPermission resourceBlockPermission) {
058                    getPersistence().clearCache(resourceBlockPermission);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
063             */
064            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<ResourceBlockPermission> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) throws SystemException {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<ResourceBlockPermission> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end)
082                    throws SystemException {
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 orderByComparator) throws SystemException {
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, boolean)
099             */
100            public static ResourceBlockPermission update(
101                    ResourceBlockPermission resourceBlockPermission, boolean merge)
102                    throws SystemException {
103                    return getPersistence().update(resourceBlockPermission, merge);
104            }
105    
106            /**
107             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
108             */
109            public static ResourceBlockPermission update(
110                    ResourceBlockPermission resourceBlockPermission, boolean merge,
111                    ServiceContext serviceContext) throws SystemException {
112                    return getPersistence()
113                                       .update(resourceBlockPermission, merge, serviceContext);
114            }
115    
116            /**
117            * Caches the resource block permission in the entity cache if it is enabled.
118            *
119            * @param resourceBlockPermission the resource block permission
120            */
121            public static void cacheResult(
122                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission) {
123                    getPersistence().cacheResult(resourceBlockPermission);
124            }
125    
126            /**
127            * Caches the resource block permissions in the entity cache if it is enabled.
128            *
129            * @param resourceBlockPermissions the resource block permissions
130            */
131            public static void cacheResult(
132                    java.util.List<com.liferay.portal.model.ResourceBlockPermission> resourceBlockPermissions) {
133                    getPersistence().cacheResult(resourceBlockPermissions);
134            }
135    
136            /**
137            * Creates a new resource block permission with the primary key. Does not add the resource block permission to the database.
138            *
139            * @param resourceBlockPermissionId the primary key for the new resource block permission
140            * @return the new resource block permission
141            */
142            public static com.liferay.portal.model.ResourceBlockPermission create(
143                    long resourceBlockPermissionId) {
144                    return getPersistence().create(resourceBlockPermissionId);
145            }
146    
147            /**
148            * Removes the resource block permission with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param resourceBlockPermissionId the primary key of the resource block permission
151            * @return the resource block permission that was removed
152            * @throws com.liferay.portal.NoSuchResourceBlockPermissionException if a resource block permission with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portal.model.ResourceBlockPermission remove(
156                    long resourceBlockPermissionId)
157                    throws com.liferay.portal.NoSuchResourceBlockPermissionException,
158                            com.liferay.portal.kernel.exception.SystemException {
159                    return getPersistence().remove(resourceBlockPermissionId);
160            }
161    
162            public static com.liferay.portal.model.ResourceBlockPermission updateImpl(
163                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission,
164                    boolean merge)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence().updateImpl(resourceBlockPermission, merge);
167            }
168    
169            /**
170            * Returns the resource block permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourceBlockPermissionException} if it could not be found.
171            *
172            * @param resourceBlockPermissionId the primary key of the resource block permission
173            * @return the resource block permission
174            * @throws com.liferay.portal.NoSuchResourceBlockPermissionException if a resource block permission with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portal.model.ResourceBlockPermission findByPrimaryKey(
178                    long resourceBlockPermissionId)
179                    throws com.liferay.portal.NoSuchResourceBlockPermissionException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getPersistence().findByPrimaryKey(resourceBlockPermissionId);
182            }
183    
184            /**
185            * Returns the resource block permission with the primary key or returns <code>null</code> if it could not be found.
186            *
187            * @param resourceBlockPermissionId the primary key of the resource block permission
188            * @return the resource block permission, or <code>null</code> if a resource block permission with the primary key could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public static com.liferay.portal.model.ResourceBlockPermission fetchByPrimaryKey(
192                    long resourceBlockPermissionId)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByPrimaryKey(resourceBlockPermissionId);
195            }
196    
197            /**
198            * Returns all the resource block permissions where resourceBlockId = &#63;.
199            *
200            * @param resourceBlockId the resource block ID
201            * @return the matching resource block permissions
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> findByResourceBlockId(
205                    long resourceBlockId)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    return getPersistence().findByResourceBlockId(resourceBlockId);
208            }
209    
210            /**
211            * Returns a range of all the resource block permissions where resourceBlockId = &#63;.
212            *
213            * <p>
214            * 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.
215            * </p>
216            *
217            * @param resourceBlockId the resource block ID
218            * @param start the lower bound of the range of resource block permissions
219            * @param end the upper bound of the range of resource block permissions (not inclusive)
220            * @return the range of matching resource block permissions
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> findByResourceBlockId(
224                    long resourceBlockId, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence()
227                                       .findByResourceBlockId(resourceBlockId, start, end);
228            }
229    
230            /**
231            * Returns an ordered range of all the resource block permissions where resourceBlockId = &#63;.
232            *
233            * <p>
234            * 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.
235            * </p>
236            *
237            * @param resourceBlockId the resource block ID
238            * @param start the lower bound of the range of resource block permissions
239            * @param end the upper bound of the range of resource block permissions (not inclusive)
240            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
241            * @return the ordered range of matching resource block permissions
242            * @throws SystemException if a system exception occurred
243            */
244            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> findByResourceBlockId(
245                    long resourceBlockId, int start, int end,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return getPersistence()
249                                       .findByResourceBlockId(resourceBlockId, start, end,
250                            orderByComparator);
251            }
252    
253            /**
254            * Returns the first resource block permission in the ordered set where resourceBlockId = &#63;.
255            *
256            * <p>
257            * 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.
258            * </p>
259            *
260            * @param resourceBlockId the resource block ID
261            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
262            * @return the first matching resource block permission
263            * @throws com.liferay.portal.NoSuchResourceBlockPermissionException if a matching resource block permission could not be found
264            * @throws SystemException if a system exception occurred
265            */
266            public static com.liferay.portal.model.ResourceBlockPermission findByResourceBlockId_First(
267                    long resourceBlockId,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.NoSuchResourceBlockPermissionException,
270                            com.liferay.portal.kernel.exception.SystemException {
271                    return getPersistence()
272                                       .findByResourceBlockId_First(resourceBlockId,
273                            orderByComparator);
274            }
275    
276            /**
277            * Returns the last resource block permission in the ordered set where resourceBlockId = &#63;.
278            *
279            * <p>
280            * 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.
281            * </p>
282            *
283            * @param resourceBlockId the resource block ID
284            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
285            * @return the last matching resource block permission
286            * @throws com.liferay.portal.NoSuchResourceBlockPermissionException if a matching resource block permission could not be found
287            * @throws SystemException if a system exception occurred
288            */
289            public static com.liferay.portal.model.ResourceBlockPermission findByResourceBlockId_Last(
290                    long resourceBlockId,
291                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
292                    throws com.liferay.portal.NoSuchResourceBlockPermissionException,
293                            com.liferay.portal.kernel.exception.SystemException {
294                    return getPersistence()
295                                       .findByResourceBlockId_Last(resourceBlockId,
296                            orderByComparator);
297            }
298    
299            /**
300            * Returns the resource block permissions before and after the current resource block permission in the ordered set where resourceBlockId = &#63;.
301            *
302            * <p>
303            * 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.
304            * </p>
305            *
306            * @param resourceBlockPermissionId the primary key of the current resource block permission
307            * @param resourceBlockId the resource block ID
308            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
309            * @return the previous, current, and next resource block permission
310            * @throws com.liferay.portal.NoSuchResourceBlockPermissionException if a resource block permission with the primary key could not be found
311            * @throws SystemException if a system exception occurred
312            */
313            public static com.liferay.portal.model.ResourceBlockPermission[] findByResourceBlockId_PrevAndNext(
314                    long resourceBlockPermissionId, long resourceBlockId,
315                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
316                    throws com.liferay.portal.NoSuchResourceBlockPermissionException,
317                            com.liferay.portal.kernel.exception.SystemException {
318                    return getPersistence()
319                                       .findByResourceBlockId_PrevAndNext(resourceBlockPermissionId,
320                            resourceBlockId, orderByComparator);
321            }
322    
323            /**
324            * 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.
325            *
326            * @param resourceBlockId the resource block ID
327            * @param roleId the role ID
328            * @return the matching resource block permission
329            * @throws com.liferay.portal.NoSuchResourceBlockPermissionException if a matching resource block permission could not be found
330            * @throws SystemException if a system exception occurred
331            */
332            public static com.liferay.portal.model.ResourceBlockPermission findByR_R(
333                    long resourceBlockId, long roleId)
334                    throws com.liferay.portal.NoSuchResourceBlockPermissionException,
335                            com.liferay.portal.kernel.exception.SystemException {
336                    return getPersistence().findByR_R(resourceBlockId, roleId);
337            }
338    
339            /**
340            * 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.
341            *
342            * @param resourceBlockId the resource block ID
343            * @param roleId the role ID
344            * @return the matching resource block permission, or <code>null</code> if a matching resource block permission could not be found
345            * @throws SystemException if a system exception occurred
346            */
347            public static com.liferay.portal.model.ResourceBlockPermission fetchByR_R(
348                    long resourceBlockId, long roleId)
349                    throws com.liferay.portal.kernel.exception.SystemException {
350                    return getPersistence().fetchByR_R(resourceBlockId, roleId);
351            }
352    
353            /**
354            * 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.
355            *
356            * @param resourceBlockId the resource block ID
357            * @param roleId the role ID
358            * @param retrieveFromCache whether to use the finder cache
359            * @return the matching resource block permission, or <code>null</code> if a matching resource block permission could not be found
360            * @throws SystemException if a system exception occurred
361            */
362            public static com.liferay.portal.model.ResourceBlockPermission fetchByR_R(
363                    long resourceBlockId, long roleId, boolean retrieveFromCache)
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    return getPersistence()
366                                       .fetchByR_R(resourceBlockId, roleId, retrieveFromCache);
367            }
368    
369            /**
370            * Returns all the resource block permissions.
371            *
372            * @return the resource block permissions
373            * @throws SystemException if a system exception occurred
374            */
375            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> findAll()
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return getPersistence().findAll();
378            }
379    
380            /**
381            * Returns a range of all the resource block permissions.
382            *
383            * <p>
384            * 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.
385            * </p>
386            *
387            * @param start the lower bound of the range of resource block permissions
388            * @param end the upper bound of the range of resource block permissions (not inclusive)
389            * @return the range of resource block permissions
390            * @throws SystemException if a system exception occurred
391            */
392            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> findAll(
393                    int start, int end)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    return getPersistence().findAll(start, end);
396            }
397    
398            /**
399            * Returns an ordered range of all the resource block permissions.
400            *
401            * <p>
402            * 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.
403            * </p>
404            *
405            * @param start the lower bound of the range of resource block permissions
406            * @param end the upper bound of the range of resource block permissions (not inclusive)
407            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
408            * @return the ordered range of resource block permissions
409            * @throws SystemException if a system exception occurred
410            */
411            public static java.util.List<com.liferay.portal.model.ResourceBlockPermission> findAll(
412                    int start, int end,
413                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
414                    throws com.liferay.portal.kernel.exception.SystemException {
415                    return getPersistence().findAll(start, end, orderByComparator);
416            }
417    
418            /**
419            * Removes all the resource block permissions where resourceBlockId = &#63; from the database.
420            *
421            * @param resourceBlockId the resource block ID
422            * @throws SystemException if a system exception occurred
423            */
424            public static void removeByResourceBlockId(long resourceBlockId)
425                    throws com.liferay.portal.kernel.exception.SystemException {
426                    getPersistence().removeByResourceBlockId(resourceBlockId);
427            }
428    
429            /**
430            * Removes the resource block permission where resourceBlockId = &#63; and roleId = &#63; from the database.
431            *
432            * @param resourceBlockId the resource block ID
433            * @param roleId the role ID
434            * @throws SystemException if a system exception occurred
435            */
436            public static void removeByR_R(long resourceBlockId, long roleId)
437                    throws com.liferay.portal.NoSuchResourceBlockPermissionException,
438                            com.liferay.portal.kernel.exception.SystemException {
439                    getPersistence().removeByR_R(resourceBlockId, roleId);
440            }
441    
442            /**
443            * Removes all the resource block permissions from the database.
444            *
445            * @throws SystemException if a system exception occurred
446            */
447            public static void removeAll()
448                    throws com.liferay.portal.kernel.exception.SystemException {
449                    getPersistence().removeAll();
450            }
451    
452            /**
453            * Returns the number of resource block permissions where resourceBlockId = &#63;.
454            *
455            * @param resourceBlockId the resource block ID
456            * @return the number of matching resource block permissions
457            * @throws SystemException if a system exception occurred
458            */
459            public static int countByResourceBlockId(long resourceBlockId)
460                    throws com.liferay.portal.kernel.exception.SystemException {
461                    return getPersistence().countByResourceBlockId(resourceBlockId);
462            }
463    
464            /**
465            * Returns the number of resource block permissions where resourceBlockId = &#63; and roleId = &#63;.
466            *
467            * @param resourceBlockId the resource block ID
468            * @param roleId the role ID
469            * @return the number of matching resource block permissions
470            * @throws SystemException if a system exception occurred
471            */
472            public static int countByR_R(long resourceBlockId, long roleId)
473                    throws com.liferay.portal.kernel.exception.SystemException {
474                    return getPersistence().countByR_R(resourceBlockId, roleId);
475            }
476    
477            /**
478            * Returns the number of resource block permissions.
479            *
480            * @return the number of resource block permissions
481            * @throws SystemException if a system exception occurred
482            */
483            public static int countAll()
484                    throws com.liferay.portal.kernel.exception.SystemException {
485                    return getPersistence().countAll();
486            }
487    
488            public static ResourceBlockPermissionPersistence getPersistence() {
489                    if (_persistence == null) {
490                            _persistence = (ResourceBlockPermissionPersistence)PortalBeanLocatorUtil.locate(ResourceBlockPermissionPersistence.class.getName());
491    
492                            ReferenceRegistry.registerReference(ResourceBlockPermissionUtil.class,
493                                    "_persistence");
494                    }
495    
496                    return _persistence;
497            }
498    
499            public void setPersistence(ResourceBlockPermissionPersistence persistence) {
500                    _persistence = persistence;
501    
502                    ReferenceRegistry.registerReference(ResourceBlockPermissionUtil.class,
503                            "_persistence");
504            }
505    
506            private static ResourceBlockPermissionPersistence _persistence;
507    }