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 the first resource action in the ordered set where name = &#63;.
158            *
159            * @param name the name
160            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
161            * @return the first matching resource action
162            * @throws NoSuchResourceActionException if a matching resource action could not be found
163            */
164            public static ResourceAction findByName_First(java.lang.String name,
165                    OrderByComparator<ResourceAction> orderByComparator)
166                    throws com.liferay.portal.NoSuchResourceActionException {
167                    return getPersistence().findByName_First(name, orderByComparator);
168            }
169    
170            /**
171            * Returns the first resource action in the ordered set where name = &#63;.
172            *
173            * @param name the name
174            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
175            * @return the first matching resource action, or <code>null</code> if a matching resource action could not be found
176            */
177            public static ResourceAction fetchByName_First(java.lang.String name,
178                    OrderByComparator<ResourceAction> orderByComparator) {
179                    return getPersistence().fetchByName_First(name, orderByComparator);
180            }
181    
182            /**
183            * Returns the last resource action in the ordered set where name = &#63;.
184            *
185            * @param name the name
186            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
187            * @return the last matching resource action
188            * @throws NoSuchResourceActionException if a matching resource action could not be found
189            */
190            public static ResourceAction findByName_Last(java.lang.String name,
191                    OrderByComparator<ResourceAction> orderByComparator)
192                    throws com.liferay.portal.NoSuchResourceActionException {
193                    return getPersistence().findByName_Last(name, orderByComparator);
194            }
195    
196            /**
197            * Returns the last resource action in the ordered set where name = &#63;.
198            *
199            * @param name the name
200            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
201            * @return the last matching resource action, or <code>null</code> if a matching resource action could not be found
202            */
203            public static ResourceAction fetchByName_Last(java.lang.String name,
204                    OrderByComparator<ResourceAction> orderByComparator) {
205                    return getPersistence().fetchByName_Last(name, orderByComparator);
206            }
207    
208            /**
209            * Returns the resource actions before and after the current resource action in the ordered set where name = &#63;.
210            *
211            * @param resourceActionId the primary key of the current resource action
212            * @param name the name
213            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
214            * @return the previous, current, and next resource action
215            * @throws NoSuchResourceActionException if a resource action with the primary key could not be found
216            */
217            public static ResourceAction[] findByName_PrevAndNext(
218                    long resourceActionId, java.lang.String name,
219                    OrderByComparator<ResourceAction> orderByComparator)
220                    throws com.liferay.portal.NoSuchResourceActionException {
221                    return getPersistence()
222                                       .findByName_PrevAndNext(resourceActionId, name,
223                            orderByComparator);
224            }
225    
226            /**
227            * Removes all the resource actions where name = &#63; from the database.
228            *
229            * @param name the name
230            */
231            public static void removeByName(java.lang.String name) {
232                    getPersistence().removeByName(name);
233            }
234    
235            /**
236            * Returns the number of resource actions where name = &#63;.
237            *
238            * @param name the name
239            * @return the number of matching resource actions
240            */
241            public static int countByName(java.lang.String name) {
242                    return getPersistence().countByName(name);
243            }
244    
245            /**
246            * Returns the resource action where name = &#63; and actionId = &#63; or throws a {@link NoSuchResourceActionException} if it could not be found.
247            *
248            * @param name the name
249            * @param actionId the action ID
250            * @return the matching resource action
251            * @throws NoSuchResourceActionException if a matching resource action could not be found
252            */
253            public static ResourceAction findByN_A(java.lang.String name,
254                    java.lang.String actionId)
255                    throws com.liferay.portal.NoSuchResourceActionException {
256                    return getPersistence().findByN_A(name, actionId);
257            }
258    
259            /**
260            * 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.
261            *
262            * @param name the name
263            * @param actionId the action ID
264            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
265            */
266            public static ResourceAction fetchByN_A(java.lang.String name,
267                    java.lang.String actionId) {
268                    return getPersistence().fetchByN_A(name, actionId);
269            }
270    
271            /**
272            * 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.
273            *
274            * @param name the name
275            * @param actionId the action ID
276            * @param retrieveFromCache whether to use the finder cache
277            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
278            */
279            public static ResourceAction fetchByN_A(java.lang.String name,
280                    java.lang.String actionId, boolean retrieveFromCache) {
281                    return getPersistence().fetchByN_A(name, actionId, retrieveFromCache);
282            }
283    
284            /**
285            * Removes the resource action where name = &#63; and actionId = &#63; from the database.
286            *
287            * @param name the name
288            * @param actionId the action ID
289            * @return the resource action that was removed
290            */
291            public static ResourceAction removeByN_A(java.lang.String name,
292                    java.lang.String actionId)
293                    throws com.liferay.portal.NoSuchResourceActionException {
294                    return getPersistence().removeByN_A(name, actionId);
295            }
296    
297            /**
298            * Returns the number of resource actions where name = &#63; and actionId = &#63;.
299            *
300            * @param name the name
301            * @param actionId the action ID
302            * @return the number of matching resource actions
303            */
304            public static int countByN_A(java.lang.String name,
305                    java.lang.String actionId) {
306                    return getPersistence().countByN_A(name, actionId);
307            }
308    
309            /**
310            * Caches the resource action in the entity cache if it is enabled.
311            *
312            * @param resourceAction the resource action
313            */
314            public static void cacheResult(ResourceAction resourceAction) {
315                    getPersistence().cacheResult(resourceAction);
316            }
317    
318            /**
319            * Caches the resource actions in the entity cache if it is enabled.
320            *
321            * @param resourceActions the resource actions
322            */
323            public static void cacheResult(List<ResourceAction> resourceActions) {
324                    getPersistence().cacheResult(resourceActions);
325            }
326    
327            /**
328            * Creates a new resource action with the primary key. Does not add the resource action to the database.
329            *
330            * @param resourceActionId the primary key for the new resource action
331            * @return the new resource action
332            */
333            public static ResourceAction create(long resourceActionId) {
334                    return getPersistence().create(resourceActionId);
335            }
336    
337            /**
338            * Removes the resource action with the primary key from the database. Also notifies the appropriate model listeners.
339            *
340            * @param resourceActionId the primary key of the resource action
341            * @return the resource action that was removed
342            * @throws NoSuchResourceActionException if a resource action with the primary key could not be found
343            */
344            public static ResourceAction remove(long resourceActionId)
345                    throws com.liferay.portal.NoSuchResourceActionException {
346                    return getPersistence().remove(resourceActionId);
347            }
348    
349            public static ResourceAction updateImpl(ResourceAction resourceAction) {
350                    return getPersistence().updateImpl(resourceAction);
351            }
352    
353            /**
354            * Returns the resource action with the primary key or throws a {@link NoSuchResourceActionException} if it could not be found.
355            *
356            * @param resourceActionId the primary key of the resource action
357            * @return the resource action
358            * @throws NoSuchResourceActionException if a resource action with the primary key could not be found
359            */
360            public static ResourceAction findByPrimaryKey(long resourceActionId)
361                    throws com.liferay.portal.NoSuchResourceActionException {
362                    return getPersistence().findByPrimaryKey(resourceActionId);
363            }
364    
365            /**
366            * Returns the resource action with the primary key or returns <code>null</code> if it could not be found.
367            *
368            * @param resourceActionId the primary key of the resource action
369            * @return the resource action, or <code>null</code> if a resource action with the primary key could not be found
370            */
371            public static ResourceAction fetchByPrimaryKey(long resourceActionId) {
372                    return getPersistence().fetchByPrimaryKey(resourceActionId);
373            }
374    
375            public static java.util.Map<java.io.Serializable, ResourceAction> fetchByPrimaryKeys(
376                    java.util.Set<java.io.Serializable> primaryKeys) {
377                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
378            }
379    
380            /**
381            * Returns all the resource actions.
382            *
383            * @return the resource actions
384            */
385            public static List<ResourceAction> findAll() {
386                    return getPersistence().findAll();
387            }
388    
389            /**
390            * Returns a range of all the resource actions.
391            *
392            * <p>
393            * 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.
394            * </p>
395            *
396            * @param start the lower bound of the range of resource actions
397            * @param end the upper bound of the range of resource actions (not inclusive)
398            * @return the range of resource actions
399            */
400            public static List<ResourceAction> findAll(int start, int end) {
401                    return getPersistence().findAll(start, end);
402            }
403    
404            /**
405            * Returns an ordered range of all the resource actions.
406            *
407            * <p>
408            * 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.
409            * </p>
410            *
411            * @param start the lower bound of the range of resource actions
412            * @param end the upper bound of the range of resource actions (not inclusive)
413            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
414            * @return the ordered range of resource actions
415            */
416            public static List<ResourceAction> findAll(int start, int end,
417                    OrderByComparator<ResourceAction> orderByComparator) {
418                    return getPersistence().findAll(start, end, orderByComparator);
419            }
420    
421            /**
422            * Removes all the resource actions from the database.
423            */
424            public static void removeAll() {
425                    getPersistence().removeAll();
426            }
427    
428            /**
429            * Returns the number of resource actions.
430            *
431            * @return the number of resource actions
432            */
433            public static int countAll() {
434                    return getPersistence().countAll();
435            }
436    
437            public static ResourceActionPersistence getPersistence() {
438                    if (_persistence == null) {
439                            _persistence = (ResourceActionPersistence)PortalBeanLocatorUtil.locate(ResourceActionPersistence.class.getName());
440    
441                            ReferenceRegistry.registerReference(ResourceActionUtil.class,
442                                    "_persistence");
443                    }
444    
445                    return _persistence;
446            }
447    
448            /**
449             * @deprecated As of 6.2.0
450             */
451            @Deprecated
452            public void setPersistence(ResourceActionPersistence persistence) {
453            }
454    
455            private static ResourceActionPersistence _persistence;
456    }