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