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