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