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