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.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            * <p>
253            * 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.
254            * </p>
255            *
256            * @param companyId the company ID
257            * @param name the name
258            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
259            * @return the first matching resource block
260            * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found
261            * @throws SystemException if a system exception occurred
262            */
263            public static com.liferay.portal.model.ResourceBlock findByC_N_First(
264                    long companyId, java.lang.String name,
265                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266                    throws com.liferay.portal.NoSuchResourceBlockException,
267                            com.liferay.portal.kernel.exception.SystemException {
268                    return getPersistence()
269                                       .findByC_N_First(companyId, name, orderByComparator);
270            }
271    
272            /**
273            * Returns the last resource block in the ordered set where companyId = &#63; and name = &#63;.
274            *
275            * <p>
276            * 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.
277            * </p>
278            *
279            * @param companyId the company ID
280            * @param name the name
281            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
282            * @return the last matching resource block
283            * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found
284            * @throws SystemException if a system exception occurred
285            */
286            public static com.liferay.portal.model.ResourceBlock findByC_N_Last(
287                    long companyId, java.lang.String name,
288                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
289                    throws com.liferay.portal.NoSuchResourceBlockException,
290                            com.liferay.portal.kernel.exception.SystemException {
291                    return getPersistence()
292                                       .findByC_N_Last(companyId, name, orderByComparator);
293            }
294    
295            /**
296            * Returns the resource blocks before and after the current resource block in the ordered set where companyId = &#63; and name = &#63;.
297            *
298            * <p>
299            * 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.
300            * </p>
301            *
302            * @param resourceBlockId the primary key of the current resource block
303            * @param companyId the company ID
304            * @param name the name
305            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
306            * @return the previous, current, and next resource block
307            * @throws com.liferay.portal.NoSuchResourceBlockException if a resource block with the primary key could not be found
308            * @throws SystemException if a system exception occurred
309            */
310            public static com.liferay.portal.model.ResourceBlock[] findByC_N_PrevAndNext(
311                    long resourceBlockId, long companyId, java.lang.String name,
312                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
313                    throws com.liferay.portal.NoSuchResourceBlockException,
314                            com.liferay.portal.kernel.exception.SystemException {
315                    return getPersistence()
316                                       .findByC_N_PrevAndNext(resourceBlockId, companyId, name,
317                            orderByComparator);
318            }
319    
320            /**
321            * Returns all the resource blocks where companyId = &#63; and groupId = &#63; and name = &#63;.
322            *
323            * @param companyId the company ID
324            * @param groupId the group ID
325            * @param name the name
326            * @return the matching resource blocks
327            * @throws SystemException if a system exception occurred
328            */
329            public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_G_N(
330                    long companyId, long groupId, java.lang.String name)
331                    throws com.liferay.portal.kernel.exception.SystemException {
332                    return getPersistence().findByC_G_N(companyId, groupId, name);
333            }
334    
335            /**
336            * Returns a range of all the resource blocks where companyId = &#63; and groupId = &#63; and name = &#63;.
337            *
338            * <p>
339            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
340            * </p>
341            *
342            * @param companyId the company ID
343            * @param groupId the group ID
344            * @param name the name
345            * @param start the lower bound of the range of resource blocks
346            * @param end the upper bound of the range of resource blocks (not inclusive)
347            * @return the range of matching resource blocks
348            * @throws SystemException if a system exception occurred
349            */
350            public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_G_N(
351                    long companyId, long groupId, java.lang.String name, int start, int end)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    return getPersistence().findByC_G_N(companyId, groupId, name, start, end);
354            }
355    
356            /**
357            * Returns an ordered range of all the resource blocks where companyId = &#63; and groupId = &#63; and name = &#63;.
358            *
359            * <p>
360            * 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.
361            * </p>
362            *
363            * @param companyId the company ID
364            * @param groupId the group ID
365            * @param name the name
366            * @param start the lower bound of the range of resource blocks
367            * @param end the upper bound of the range of resource blocks (not inclusive)
368            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
369            * @return the ordered 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,
374                    int end,
375                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return getPersistence()
378                                       .findByC_G_N(companyId, groupId, name, start, end,
379                            orderByComparator);
380            }
381    
382            /**
383            * Returns the first resource block in the ordered set where companyId = &#63; and groupId = &#63; and name = &#63;.
384            *
385            * <p>
386            * 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.
387            * </p>
388            *
389            * @param companyId the company ID
390            * @param groupId the group ID
391            * @param name the name
392            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
393            * @return the first matching resource block
394            * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found
395            * @throws SystemException if a system exception occurred
396            */
397            public static com.liferay.portal.model.ResourceBlock findByC_G_N_First(
398                    long companyId, long groupId, java.lang.String name,
399                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
400                    throws com.liferay.portal.NoSuchResourceBlockException,
401                            com.liferay.portal.kernel.exception.SystemException {
402                    return getPersistence()
403                                       .findByC_G_N_First(companyId, groupId, name,
404                            orderByComparator);
405            }
406    
407            /**
408            * Returns the last resource block in the ordered set where companyId = &#63; and groupId = &#63; and name = &#63;.
409            *
410            * <p>
411            * 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.
412            * </p>
413            *
414            * @param companyId the company ID
415            * @param groupId the group ID
416            * @param name the name
417            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
418            * @return the last matching resource block
419            * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found
420            * @throws SystemException if a system exception occurred
421            */
422            public static com.liferay.portal.model.ResourceBlock findByC_G_N_Last(
423                    long companyId, long groupId, java.lang.String name,
424                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
425                    throws com.liferay.portal.NoSuchResourceBlockException,
426                            com.liferay.portal.kernel.exception.SystemException {
427                    return getPersistence()
428                                       .findByC_G_N_Last(companyId, groupId, name, orderByComparator);
429            }
430    
431            /**
432            * Returns the resource blocks before and after the current resource block in the ordered set where companyId = &#63; and groupId = &#63; and name = &#63;.
433            *
434            * <p>
435            * 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.
436            * </p>
437            *
438            * @param resourceBlockId the primary key of the current resource block
439            * @param companyId the company ID
440            * @param groupId the group ID
441            * @param name the name
442            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
443            * @return the previous, current, and next resource block
444            * @throws com.liferay.portal.NoSuchResourceBlockException if a resource block with the primary key could not be found
445            * @throws SystemException if a system exception occurred
446            */
447            public static com.liferay.portal.model.ResourceBlock[] findByC_G_N_PrevAndNext(
448                    long resourceBlockId, long companyId, long groupId,
449                    java.lang.String name,
450                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
451                    throws com.liferay.portal.NoSuchResourceBlockException,
452                            com.liferay.portal.kernel.exception.SystemException {
453                    return getPersistence()
454                                       .findByC_G_N_PrevAndNext(resourceBlockId, companyId,
455                            groupId, name, orderByComparator);
456            }
457    
458            /**
459            * 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.
460            *
461            * @param companyId the company ID
462            * @param groupId the group ID
463            * @param name the name
464            * @param permissionsHash the permissions hash
465            * @return the matching resource block
466            * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found
467            * @throws SystemException if a system exception occurred
468            */
469            public static com.liferay.portal.model.ResourceBlock findByC_G_N_P(
470                    long companyId, long groupId, java.lang.String name,
471                    java.lang.String permissionsHash)
472                    throws com.liferay.portal.NoSuchResourceBlockException,
473                            com.liferay.portal.kernel.exception.SystemException {
474                    return getPersistence()
475                                       .findByC_G_N_P(companyId, groupId, name, permissionsHash);
476            }
477    
478            /**
479            * 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.
480            *
481            * @param companyId the company ID
482            * @param groupId the group ID
483            * @param name the name
484            * @param permissionsHash the permissions hash
485            * @return the matching resource block, or <code>null</code> if a matching resource block could not be found
486            * @throws SystemException if a system exception occurred
487            */
488            public static com.liferay.portal.model.ResourceBlock fetchByC_G_N_P(
489                    long companyId, long groupId, java.lang.String name,
490                    java.lang.String permissionsHash)
491                    throws com.liferay.portal.kernel.exception.SystemException {
492                    return getPersistence()
493                                       .fetchByC_G_N_P(companyId, groupId, name, permissionsHash);
494            }
495    
496            /**
497            * 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.
498            *
499            * @param companyId the company ID
500            * @param groupId the group ID
501            * @param name the name
502            * @param permissionsHash the permissions hash
503            * @param retrieveFromCache whether to use the finder cache
504            * @return the matching resource block, or <code>null</code> if a matching resource block could not be found
505            * @throws SystemException if a system exception occurred
506            */
507            public static com.liferay.portal.model.ResourceBlock fetchByC_G_N_P(
508                    long companyId, long groupId, java.lang.String name,
509                    java.lang.String permissionsHash, boolean retrieveFromCache)
510                    throws com.liferay.portal.kernel.exception.SystemException {
511                    return getPersistence()
512                                       .fetchByC_G_N_P(companyId, groupId, name, permissionsHash,
513                            retrieveFromCache);
514            }
515    
516            /**
517            * Returns all the resource blocks.
518            *
519            * @return the resource blocks
520            * @throws SystemException if a system exception occurred
521            */
522            public static java.util.List<com.liferay.portal.model.ResourceBlock> findAll()
523                    throws com.liferay.portal.kernel.exception.SystemException {
524                    return getPersistence().findAll();
525            }
526    
527            /**
528            * Returns a range of all the resource blocks.
529            *
530            * <p>
531            * 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.
532            * </p>
533            *
534            * @param start the lower bound of the range of resource blocks
535            * @param end the upper bound of the range of resource blocks (not inclusive)
536            * @return the range of resource blocks
537            * @throws SystemException if a system exception occurred
538            */
539            public static java.util.List<com.liferay.portal.model.ResourceBlock> findAll(
540                    int start, int end)
541                    throws com.liferay.portal.kernel.exception.SystemException {
542                    return getPersistence().findAll(start, end);
543            }
544    
545            /**
546            * Returns an ordered range of all the resource blocks.
547            *
548            * <p>
549            * 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.
550            * </p>
551            *
552            * @param start the lower bound of the range of resource blocks
553            * @param end the upper bound of the range of resource blocks (not inclusive)
554            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
555            * @return the ordered range of resource blocks
556            * @throws SystemException if a system exception occurred
557            */
558            public static java.util.List<com.liferay.portal.model.ResourceBlock> findAll(
559                    int start, int end,
560                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
561                    throws com.liferay.portal.kernel.exception.SystemException {
562                    return getPersistence().findAll(start, end, orderByComparator);
563            }
564    
565            /**
566            * Removes all the resource blocks where companyId = &#63; and name = &#63; from the database.
567            *
568            * @param companyId the company ID
569            * @param name the name
570            * @throws SystemException if a system exception occurred
571            */
572            public static void removeByC_N(long companyId, java.lang.String name)
573                    throws com.liferay.portal.kernel.exception.SystemException {
574                    getPersistence().removeByC_N(companyId, name);
575            }
576    
577            /**
578            * Removes all the resource blocks where companyId = &#63; and groupId = &#63; and name = &#63; from the database.
579            *
580            * @param companyId the company ID
581            * @param groupId the group ID
582            * @param name the name
583            * @throws SystemException if a system exception occurred
584            */
585            public static void removeByC_G_N(long companyId, long groupId,
586                    java.lang.String name)
587                    throws com.liferay.portal.kernel.exception.SystemException {
588                    getPersistence().removeByC_G_N(companyId, groupId, name);
589            }
590    
591            /**
592            * Removes the resource block where companyId = &#63; and groupId = &#63; and name = &#63; and permissionsHash = &#63; from the database.
593            *
594            * @param companyId the company ID
595            * @param groupId the group ID
596            * @param name the name
597            * @param permissionsHash the permissions hash
598            * @throws SystemException if a system exception occurred
599            */
600            public static void removeByC_G_N_P(long companyId, long groupId,
601                    java.lang.String name, java.lang.String permissionsHash)
602                    throws com.liferay.portal.NoSuchResourceBlockException,
603                            com.liferay.portal.kernel.exception.SystemException {
604                    getPersistence()
605                            .removeByC_G_N_P(companyId, groupId, name, permissionsHash);
606            }
607    
608            /**
609            * Removes all the resource blocks from the database.
610            *
611            * @throws SystemException if a system exception occurred
612            */
613            public static void removeAll()
614                    throws com.liferay.portal.kernel.exception.SystemException {
615                    getPersistence().removeAll();
616            }
617    
618            /**
619            * Returns the number of resource blocks where companyId = &#63; and name = &#63;.
620            *
621            * @param companyId the company ID
622            * @param name the name
623            * @return the number of matching resource blocks
624            * @throws SystemException if a system exception occurred
625            */
626            public static int countByC_N(long companyId, java.lang.String name)
627                    throws com.liferay.portal.kernel.exception.SystemException {
628                    return getPersistence().countByC_N(companyId, name);
629            }
630    
631            /**
632            * Returns the number of resource blocks where companyId = &#63; and groupId = &#63; and name = &#63;.
633            *
634            * @param companyId the company ID
635            * @param groupId the group ID
636            * @param name the name
637            * @return the number of matching resource blocks
638            * @throws SystemException if a system exception occurred
639            */
640            public static int countByC_G_N(long companyId, long groupId,
641                    java.lang.String name)
642                    throws com.liferay.portal.kernel.exception.SystemException {
643                    return getPersistence().countByC_G_N(companyId, groupId, name);
644            }
645    
646            /**
647            * Returns the number of resource blocks where companyId = &#63; and groupId = &#63; and name = &#63; and permissionsHash = &#63;.
648            *
649            * @param companyId the company ID
650            * @param groupId the group ID
651            * @param name the name
652            * @param permissionsHash the permissions hash
653            * @return the number of matching resource blocks
654            * @throws SystemException if a system exception occurred
655            */
656            public static int countByC_G_N_P(long companyId, long groupId,
657                    java.lang.String name, java.lang.String permissionsHash)
658                    throws com.liferay.portal.kernel.exception.SystemException {
659                    return getPersistence()
660                                       .countByC_G_N_P(companyId, groupId, name, permissionsHash);
661            }
662    
663            /**
664            * Returns the number of resource blocks.
665            *
666            * @return the number of resource blocks
667            * @throws SystemException if a system exception occurred
668            */
669            public static int countAll()
670                    throws com.liferay.portal.kernel.exception.SystemException {
671                    return getPersistence().countAll();
672            }
673    
674            public static ResourceBlockPersistence getPersistence() {
675                    if (_persistence == null) {
676                            _persistence = (ResourceBlockPersistence)PortalBeanLocatorUtil.locate(ResourceBlockPersistence.class.getName());
677    
678                            ReferenceRegistry.registerReference(ResourceBlockUtil.class,
679                                    "_persistence");
680                    }
681    
682                    return _persistence;
683            }
684    
685            public void setPersistence(ResourceBlockPersistence persistence) {
686                    _persistence = persistence;
687    
688                    ReferenceRegistry.registerReference(ResourceBlockUtil.class,
689                            "_persistence");
690            }
691    
692            private static ResourceBlockPersistence _persistence;
693    }