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