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.ResourceAction;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the resource action service. This utility wraps {@link com.liferay.portal.service.persistence.impl.ResourceActionPersistenceImpl} 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 ResourceActionPersistence
037     * @see com.liferay.portal.service.persistence.impl.ResourceActionPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class ResourceActionUtil {
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(ResourceAction resourceAction) {
059                    getPersistence().clearCache(resourceAction);
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<ResourceAction> 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<ResourceAction> 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<ResourceAction> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator<ResourceAction> 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 ResourceAction update(ResourceAction resourceAction) {
100                    return getPersistence().update(resourceAction);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static ResourceAction update(ResourceAction resourceAction,
107                    ServiceContext serviceContext) {
108                    return getPersistence().update(resourceAction, serviceContext);
109            }
110    
111            /**
112            * Returns all the resource actions where name = &#63;.
113            *
114            * @param name the name
115            * @return the matching resource actions
116            */
117            public static List<ResourceAction> findByName(java.lang.String name) {
118                    return getPersistence().findByName(name);
119            }
120    
121            /**
122            * Returns a range of all the resource actions where name = &#63;.
123            *
124            * <p>
125            * 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 ResourceActionModelImpl}. 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.
126            * </p>
127            *
128            * @param name the name
129            * @param start the lower bound of the range of resource actions
130            * @param end the upper bound of the range of resource actions (not inclusive)
131            * @return the range of matching resource actions
132            */
133            public static List<ResourceAction> findByName(java.lang.String name,
134                    int start, int end) {
135                    return getPersistence().findByName(name, start, end);
136            }
137    
138            /**
139            * Returns an ordered range of all the resource actions where name = &#63;.
140            *
141            * <p>
142            * 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 ResourceActionModelImpl}. 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.
143            * </p>
144            *
145            * @param name the name
146            * @param start the lower bound of the range of resource actions
147            * @param end the upper bound of the range of resource actions (not inclusive)
148            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
149            * @return the ordered range of matching resource actions
150            */
151            public static List<ResourceAction> findByName(java.lang.String name,
152                    int start, int end, OrderByComparator<ResourceAction> orderByComparator) {
153                    return getPersistence().findByName(name, start, end, orderByComparator);
154            }
155    
156            /**
157            * Returns an ordered range of all the resource actions where name = &#63;.
158            *
159            * <p>
160            * 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 ResourceActionModelImpl}. 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.
161            * </p>
162            *
163            * @param name the name
164            * @param start the lower bound of the range of resource actions
165            * @param end the upper bound of the range of resource actions (not inclusive)
166            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
167            * @param retrieveFromCache whether to retrieve from the finder cache
168            * @return the ordered range of matching resource actions
169            */
170            public static List<ResourceAction> findByName(java.lang.String name,
171                    int start, int end,
172                    OrderByComparator<ResourceAction> orderByComparator,
173                    boolean retrieveFromCache) {
174                    return getPersistence()
175                                       .findByName(name, start, end, orderByComparator,
176                            retrieveFromCache);
177            }
178    
179            /**
180            * Returns the first resource action in the ordered set where name = &#63;.
181            *
182            * @param name the name
183            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
184            * @return the first matching resource action
185            * @throws NoSuchResourceActionException if a matching resource action could not be found
186            */
187            public static ResourceAction findByName_First(java.lang.String name,
188                    OrderByComparator<ResourceAction> orderByComparator)
189                    throws com.liferay.portal.exception.NoSuchResourceActionException {
190                    return getPersistence().findByName_First(name, orderByComparator);
191            }
192    
193            /**
194            * Returns the first resource action in the ordered set where name = &#63;.
195            *
196            * @param name the name
197            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
198            * @return the first matching resource action, or <code>null</code> if a matching resource action could not be found
199            */
200            public static ResourceAction fetchByName_First(java.lang.String name,
201                    OrderByComparator<ResourceAction> orderByComparator) {
202                    return getPersistence().fetchByName_First(name, orderByComparator);
203            }
204    
205            /**
206            * Returns the last resource action in the ordered set where name = &#63;.
207            *
208            * @param name the name
209            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
210            * @return the last matching resource action
211            * @throws NoSuchResourceActionException if a matching resource action could not be found
212            */
213            public static ResourceAction findByName_Last(java.lang.String name,
214                    OrderByComparator<ResourceAction> orderByComparator)
215                    throws com.liferay.portal.exception.NoSuchResourceActionException {
216                    return getPersistence().findByName_Last(name, orderByComparator);
217            }
218    
219            /**
220            * Returns the last resource action in the ordered set where name = &#63;.
221            *
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 action, or <code>null</code> if a matching resource action could not be found
225            */
226            public static ResourceAction fetchByName_Last(java.lang.String name,
227                    OrderByComparator<ResourceAction> orderByComparator) {
228                    return getPersistence().fetchByName_Last(name, orderByComparator);
229            }
230    
231            /**
232            * Returns the resource actions before and after the current resource action in the ordered set where name = &#63;.
233            *
234            * @param resourceActionId the primary key of the current resource action
235            * @param name the name
236            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
237            * @return the previous, current, and next resource action
238            * @throws NoSuchResourceActionException if a resource action with the primary key could not be found
239            */
240            public static ResourceAction[] findByName_PrevAndNext(
241                    long resourceActionId, java.lang.String name,
242                    OrderByComparator<ResourceAction> orderByComparator)
243                    throws com.liferay.portal.exception.NoSuchResourceActionException {
244                    return getPersistence()
245                                       .findByName_PrevAndNext(resourceActionId, name,
246                            orderByComparator);
247            }
248    
249            /**
250            * Removes all the resource actions where name = &#63; from the database.
251            *
252            * @param name the name
253            */
254            public static void removeByName(java.lang.String name) {
255                    getPersistence().removeByName(name);
256            }
257    
258            /**
259            * Returns the number of resource actions where name = &#63;.
260            *
261            * @param name the name
262            * @return the number of matching resource actions
263            */
264            public static int countByName(java.lang.String name) {
265                    return getPersistence().countByName(name);
266            }
267    
268            /**
269            * Returns the resource action where name = &#63; and actionId = &#63; or throws a {@link NoSuchResourceActionException} if it could not be found.
270            *
271            * @param name the name
272            * @param actionId the action ID
273            * @return the matching resource action
274            * @throws NoSuchResourceActionException if a matching resource action could not be found
275            */
276            public static ResourceAction findByN_A(java.lang.String name,
277                    java.lang.String actionId)
278                    throws com.liferay.portal.exception.NoSuchResourceActionException {
279                    return getPersistence().findByN_A(name, actionId);
280            }
281    
282            /**
283            * Returns the resource action where name = &#63; and actionId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
284            *
285            * @param name the name
286            * @param actionId the action ID
287            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
288            */
289            public static ResourceAction fetchByN_A(java.lang.String name,
290                    java.lang.String actionId) {
291                    return getPersistence().fetchByN_A(name, actionId);
292            }
293    
294            /**
295            * Returns the resource action where name = &#63; and actionId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
296            *
297            * @param name the name
298            * @param actionId the action ID
299            * @param retrieveFromCache whether to retrieve from the finder cache
300            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
301            */
302            public static ResourceAction fetchByN_A(java.lang.String name,
303                    java.lang.String actionId, boolean retrieveFromCache) {
304                    return getPersistence().fetchByN_A(name, actionId, retrieveFromCache);
305            }
306    
307            /**
308            * Removes the resource action where name = &#63; and actionId = &#63; from the database.
309            *
310            * @param name the name
311            * @param actionId the action ID
312            * @return the resource action that was removed
313            */
314            public static ResourceAction removeByN_A(java.lang.String name,
315                    java.lang.String actionId)
316                    throws com.liferay.portal.exception.NoSuchResourceActionException {
317                    return getPersistence().removeByN_A(name, actionId);
318            }
319    
320            /**
321            * Returns the number of resource actions where name = &#63; and actionId = &#63;.
322            *
323            * @param name the name
324            * @param actionId the action ID
325            * @return the number of matching resource actions
326            */
327            public static int countByN_A(java.lang.String name,
328                    java.lang.String actionId) {
329                    return getPersistence().countByN_A(name, actionId);
330            }
331    
332            /**
333            * Caches the resource action in the entity cache if it is enabled.
334            *
335            * @param resourceAction the resource action
336            */
337            public static void cacheResult(ResourceAction resourceAction) {
338                    getPersistence().cacheResult(resourceAction);
339            }
340    
341            /**
342            * Caches the resource actions in the entity cache if it is enabled.
343            *
344            * @param resourceActions the resource actions
345            */
346            public static void cacheResult(List<ResourceAction> resourceActions) {
347                    getPersistence().cacheResult(resourceActions);
348            }
349    
350            /**
351            * Creates a new resource action with the primary key. Does not add the resource action to the database.
352            *
353            * @param resourceActionId the primary key for the new resource action
354            * @return the new resource action
355            */
356            public static ResourceAction create(long resourceActionId) {
357                    return getPersistence().create(resourceActionId);
358            }
359    
360            /**
361            * Removes the resource action with the primary key from the database. Also notifies the appropriate model listeners.
362            *
363            * @param resourceActionId the primary key of the resource action
364            * @return the resource action that was removed
365            * @throws NoSuchResourceActionException if a resource action with the primary key could not be found
366            */
367            public static ResourceAction remove(long resourceActionId)
368                    throws com.liferay.portal.exception.NoSuchResourceActionException {
369                    return getPersistence().remove(resourceActionId);
370            }
371    
372            public static ResourceAction updateImpl(ResourceAction resourceAction) {
373                    return getPersistence().updateImpl(resourceAction);
374            }
375    
376            /**
377            * Returns the resource action with the primary key or throws a {@link NoSuchResourceActionException} if it could not be found.
378            *
379            * @param resourceActionId the primary key of the resource action
380            * @return the resource action
381            * @throws NoSuchResourceActionException if a resource action with the primary key could not be found
382            */
383            public static ResourceAction findByPrimaryKey(long resourceActionId)
384                    throws com.liferay.portal.exception.NoSuchResourceActionException {
385                    return getPersistence().findByPrimaryKey(resourceActionId);
386            }
387    
388            /**
389            * Returns the resource action with the primary key or returns <code>null</code> if it could not be found.
390            *
391            * @param resourceActionId the primary key of the resource action
392            * @return the resource action, or <code>null</code> if a resource action with the primary key could not be found
393            */
394            public static ResourceAction fetchByPrimaryKey(long resourceActionId) {
395                    return getPersistence().fetchByPrimaryKey(resourceActionId);
396            }
397    
398            public static java.util.Map<java.io.Serializable, ResourceAction> fetchByPrimaryKeys(
399                    java.util.Set<java.io.Serializable> primaryKeys) {
400                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
401            }
402    
403            /**
404            * Returns all the resource actions.
405            *
406            * @return the resource actions
407            */
408            public static List<ResourceAction> findAll() {
409                    return getPersistence().findAll();
410            }
411    
412            /**
413            * Returns a range of all the resource actions.
414            *
415            * <p>
416            * 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 ResourceActionModelImpl}. 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.
417            * </p>
418            *
419            * @param start the lower bound of the range of resource actions
420            * @param end the upper bound of the range of resource actions (not inclusive)
421            * @return the range of resource actions
422            */
423            public static List<ResourceAction> findAll(int start, int end) {
424                    return getPersistence().findAll(start, end);
425            }
426    
427            /**
428            * Returns an ordered range of all the resource actions.
429            *
430            * <p>
431            * 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 ResourceActionModelImpl}. 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.
432            * </p>
433            *
434            * @param start the lower bound of the range of resource actions
435            * @param end the upper bound of the range of resource actions (not inclusive)
436            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
437            * @return the ordered range of resource actions
438            */
439            public static List<ResourceAction> findAll(int start, int end,
440                    OrderByComparator<ResourceAction> orderByComparator) {
441                    return getPersistence().findAll(start, end, orderByComparator);
442            }
443    
444            /**
445            * Returns an ordered range of all the resource actions.
446            *
447            * <p>
448            * 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 ResourceActionModelImpl}. 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.
449            * </p>
450            *
451            * @param start the lower bound of the range of resource actions
452            * @param end the upper bound of the range of resource actions (not inclusive)
453            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
454            * @param retrieveFromCache whether to retrieve from the finder cache
455            * @return the ordered range of resource actions
456            */
457            public static List<ResourceAction> findAll(int start, int end,
458                    OrderByComparator<ResourceAction> orderByComparator,
459                    boolean retrieveFromCache) {
460                    return getPersistence()
461                                       .findAll(start, end, orderByComparator, retrieveFromCache);
462            }
463    
464            /**
465            * Removes all the resource actions from the database.
466            */
467            public static void removeAll() {
468                    getPersistence().removeAll();
469            }
470    
471            /**
472            * Returns the number of resource actions.
473            *
474            * @return the number of resource actions
475            */
476            public static int countAll() {
477                    return getPersistence().countAll();
478            }
479    
480            public static ResourceActionPersistence getPersistence() {
481                    if (_persistence == null) {
482                            _persistence = (ResourceActionPersistence)PortalBeanLocatorUtil.locate(ResourceActionPersistence.class.getName());
483    
484                            ReferenceRegistry.registerReference(ResourceActionUtil.class,
485                                    "_persistence");
486                    }
487    
488                    return _persistence;
489            }
490    
491            private static ResourceActionPersistence _persistence;
492    }