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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.ResourceAction;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * 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.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ResourceActionPersistence
036     * @see ResourceActionPersistenceImpl
037     * @generated
038     */
039    public class ResourceActionUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(ResourceAction resourceAction) {
057                    getPersistence().clearCache(resourceAction);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<ResourceAction> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<ResourceAction> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
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 orderByComparator) throws SystemException {
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                    throws SystemException {
101                    return getPersistence().update(resourceAction);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static ResourceAction update(ResourceAction resourceAction,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(resourceAction, serviceContext);
110            }
111    
112            /**
113            * Returns all the resource actions where name = &#63;.
114            *
115            * @param name the name
116            * @return the matching resource actions
117            * @throws SystemException if a system exception occurred
118            */
119            public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
120                    java.lang.String name)
121                    throws com.liferay.portal.kernel.exception.SystemException {
122                    return getPersistence().findByName(name);
123            }
124    
125            /**
126            * Returns a range of all the resource actions where name = &#63;.
127            *
128            * <p>
129            * 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.
130            * </p>
131            *
132            * @param name the name
133            * @param start the lower bound of the range of resource actions
134            * @param end the upper bound of the range of resource actions (not inclusive)
135            * @return the range of matching resource actions
136            * @throws SystemException if a system exception occurred
137            */
138            public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
139                    java.lang.String name, int start, int end)
140                    throws com.liferay.portal.kernel.exception.SystemException {
141                    return getPersistence().findByName(name, start, end);
142            }
143    
144            /**
145            * Returns an ordered range of all the resource actions where name = &#63;.
146            *
147            * <p>
148            * 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.
149            * </p>
150            *
151            * @param name the name
152            * @param start the lower bound of the range of resource actions
153            * @param end the upper bound of the range of resource actions (not inclusive)
154            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
155            * @return the ordered range of matching resource actions
156            * @throws SystemException if a system exception occurred
157            */
158            public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
159                    java.lang.String name, int start, int end,
160                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().findByName(name, start, end, orderByComparator);
163            }
164    
165            /**
166            * Returns the first resource action in the ordered set where name = &#63;.
167            *
168            * @param name the name
169            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
170            * @return the first matching resource action
171            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portal.model.ResourceAction findByName_First(
175                    java.lang.String name,
176                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177                    throws com.liferay.portal.NoSuchResourceActionException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getPersistence().findByName_First(name, orderByComparator);
180            }
181    
182            /**
183            * Returns the first 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 first matching resource action, or <code>null</code> if a matching resource action could not be found
188            * @throws SystemException if a system exception occurred
189            */
190            public static com.liferay.portal.model.ResourceAction fetchByName_First(
191                    java.lang.String name,
192                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByName_First(name, orderByComparator);
195            }
196    
197            /**
198            * Returns the last resource action in the ordered set where name = &#63;.
199            *
200            * @param name the name
201            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
202            * @return the last matching resource action
203            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
204            * @throws SystemException if a system exception occurred
205            */
206            public static com.liferay.portal.model.ResourceAction findByName_Last(
207                    java.lang.String name,
208                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
209                    throws com.liferay.portal.NoSuchResourceActionException,
210                            com.liferay.portal.kernel.exception.SystemException {
211                    return getPersistence().findByName_Last(name, orderByComparator);
212            }
213    
214            /**
215            * Returns the last resource action in the ordered set where name = &#63;.
216            *
217            * @param name the name
218            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
219            * @return the last matching resource action, or <code>null</code> if a matching resource action could not be found
220            * @throws SystemException if a system exception occurred
221            */
222            public static com.liferay.portal.model.ResourceAction fetchByName_Last(
223                    java.lang.String name,
224                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().fetchByName_Last(name, orderByComparator);
227            }
228    
229            /**
230            * Returns the resource actions before and after the current resource action in the ordered set where name = &#63;.
231            *
232            * @param resourceActionId the primary key of the current resource action
233            * @param name the name
234            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
235            * @return the previous, current, and next resource action
236            * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found
237            * @throws SystemException if a system exception occurred
238            */
239            public static com.liferay.portal.model.ResourceAction[] findByName_PrevAndNext(
240                    long resourceActionId, java.lang.String name,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.NoSuchResourceActionException,
243                            com.liferay.portal.kernel.exception.SystemException {
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            * @throws SystemException if a system exception occurred
254            */
255            public static void removeByName(java.lang.String name)
256                    throws com.liferay.portal.kernel.exception.SystemException {
257                    getPersistence().removeByName(name);
258            }
259    
260            /**
261            * Returns the number of resource actions where name = &#63;.
262            *
263            * @param name the name
264            * @return the number of matching resource actions
265            * @throws SystemException if a system exception occurred
266            */
267            public static int countByName(java.lang.String name)
268                    throws com.liferay.portal.kernel.exception.SystemException {
269                    return getPersistence().countByName(name);
270            }
271    
272            /**
273            * Returns the resource action where name = &#63; and actionId = &#63; or throws a {@link com.liferay.portal.NoSuchResourceActionException} if it could not be found.
274            *
275            * @param name the name
276            * @param actionId the action ID
277            * @return the matching resource action
278            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
279            * @throws SystemException if a system exception occurred
280            */
281            public static com.liferay.portal.model.ResourceAction findByN_A(
282                    java.lang.String name, java.lang.String actionId)
283                    throws com.liferay.portal.NoSuchResourceActionException,
284                            com.liferay.portal.kernel.exception.SystemException {
285                    return getPersistence().findByN_A(name, actionId);
286            }
287    
288            /**
289            * 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.
290            *
291            * @param name the name
292            * @param actionId the action ID
293            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
294            * @throws SystemException if a system exception occurred
295            */
296            public static com.liferay.portal.model.ResourceAction fetchByN_A(
297                    java.lang.String name, java.lang.String actionId)
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    return getPersistence().fetchByN_A(name, actionId);
300            }
301    
302            /**
303            * 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.
304            *
305            * @param name the name
306            * @param actionId the action ID
307            * @param retrieveFromCache whether to use the finder cache
308            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
309            * @throws SystemException if a system exception occurred
310            */
311            public static com.liferay.portal.model.ResourceAction fetchByN_A(
312                    java.lang.String name, java.lang.String actionId,
313                    boolean retrieveFromCache)
314                    throws com.liferay.portal.kernel.exception.SystemException {
315                    return getPersistence().fetchByN_A(name, actionId, retrieveFromCache);
316            }
317    
318            /**
319            * Removes the resource action where name = &#63; and actionId = &#63; from the database.
320            *
321            * @param name the name
322            * @param actionId the action ID
323            * @return the resource action that was removed
324            * @throws SystemException if a system exception occurred
325            */
326            public static com.liferay.portal.model.ResourceAction removeByN_A(
327                    java.lang.String name, java.lang.String actionId)
328                    throws com.liferay.portal.NoSuchResourceActionException,
329                            com.liferay.portal.kernel.exception.SystemException {
330                    return getPersistence().removeByN_A(name, actionId);
331            }
332    
333            /**
334            * Returns the number of resource actions where name = &#63; and actionId = &#63;.
335            *
336            * @param name the name
337            * @param actionId the action ID
338            * @return the number of matching resource actions
339            * @throws SystemException if a system exception occurred
340            */
341            public static int countByN_A(java.lang.String name,
342                    java.lang.String actionId)
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    return getPersistence().countByN_A(name, actionId);
345            }
346    
347            /**
348            * Caches the resource action in the entity cache if it is enabled.
349            *
350            * @param resourceAction the resource action
351            */
352            public static void cacheResult(
353                    com.liferay.portal.model.ResourceAction resourceAction) {
354                    getPersistence().cacheResult(resourceAction);
355            }
356    
357            /**
358            * Caches the resource actions in the entity cache if it is enabled.
359            *
360            * @param resourceActions the resource actions
361            */
362            public static void cacheResult(
363                    java.util.List<com.liferay.portal.model.ResourceAction> resourceActions) {
364                    getPersistence().cacheResult(resourceActions);
365            }
366    
367            /**
368            * Creates a new resource action with the primary key. Does not add the resource action to the database.
369            *
370            * @param resourceActionId the primary key for the new resource action
371            * @return the new resource action
372            */
373            public static com.liferay.portal.model.ResourceAction create(
374                    long resourceActionId) {
375                    return getPersistence().create(resourceActionId);
376            }
377    
378            /**
379            * Removes the resource action with the primary key from the database. Also notifies the appropriate model listeners.
380            *
381            * @param resourceActionId the primary key of the resource action
382            * @return the resource action that was removed
383            * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found
384            * @throws SystemException if a system exception occurred
385            */
386            public static com.liferay.portal.model.ResourceAction remove(
387                    long resourceActionId)
388                    throws com.liferay.portal.NoSuchResourceActionException,
389                            com.liferay.portal.kernel.exception.SystemException {
390                    return getPersistence().remove(resourceActionId);
391            }
392    
393            public static com.liferay.portal.model.ResourceAction updateImpl(
394                    com.liferay.portal.model.ResourceAction resourceAction)
395                    throws com.liferay.portal.kernel.exception.SystemException {
396                    return getPersistence().updateImpl(resourceAction);
397            }
398    
399            /**
400            * Returns the resource action with the primary key or throws a {@link com.liferay.portal.NoSuchResourceActionException} if it could not be found.
401            *
402            * @param resourceActionId the primary key of the resource action
403            * @return the resource action
404            * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found
405            * @throws SystemException if a system exception occurred
406            */
407            public static com.liferay.portal.model.ResourceAction findByPrimaryKey(
408                    long resourceActionId)
409                    throws com.liferay.portal.NoSuchResourceActionException,
410                            com.liferay.portal.kernel.exception.SystemException {
411                    return getPersistence().findByPrimaryKey(resourceActionId);
412            }
413    
414            /**
415            * Returns the resource action with the primary key or returns <code>null</code> if it could not be found.
416            *
417            * @param resourceActionId the primary key of the resource action
418            * @return the resource action, or <code>null</code> if a resource action with the primary key could not be found
419            * @throws SystemException if a system exception occurred
420            */
421            public static com.liferay.portal.model.ResourceAction fetchByPrimaryKey(
422                    long resourceActionId)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getPersistence().fetchByPrimaryKey(resourceActionId);
425            }
426    
427            /**
428            * Returns all the resource actions.
429            *
430            * @return the resource actions
431            * @throws SystemException if a system exception occurred
432            */
433            public static java.util.List<com.liferay.portal.model.ResourceAction> findAll()
434                    throws com.liferay.portal.kernel.exception.SystemException {
435                    return getPersistence().findAll();
436            }
437    
438            /**
439            * Returns a range of all the resource actions.
440            *
441            * <p>
442            * 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.
443            * </p>
444            *
445            * @param start the lower bound of the range of resource actions
446            * @param end the upper bound of the range of resource actions (not inclusive)
447            * @return the range of resource actions
448            * @throws SystemException if a system exception occurred
449            */
450            public static java.util.List<com.liferay.portal.model.ResourceAction> findAll(
451                    int start, int end)
452                    throws com.liferay.portal.kernel.exception.SystemException {
453                    return getPersistence().findAll(start, end);
454            }
455    
456            /**
457            * Returns an ordered range of all the resource actions.
458            *
459            * <p>
460            * 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.
461            * </p>
462            *
463            * @param start the lower bound of the range of resource actions
464            * @param end the upper bound of the range of resource actions (not inclusive)
465            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
466            * @return the ordered range of resource actions
467            * @throws SystemException if a system exception occurred
468            */
469            public static java.util.List<com.liferay.portal.model.ResourceAction> findAll(
470                    int start, int end,
471                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
472                    throws com.liferay.portal.kernel.exception.SystemException {
473                    return getPersistence().findAll(start, end, orderByComparator);
474            }
475    
476            /**
477            * Removes all the resource actions from the database.
478            *
479            * @throws SystemException if a system exception occurred
480            */
481            public static void removeAll()
482                    throws com.liferay.portal.kernel.exception.SystemException {
483                    getPersistence().removeAll();
484            }
485    
486            /**
487            * Returns the number of resource actions.
488            *
489            * @return the number of resource actions
490            * @throws SystemException if a system exception occurred
491            */
492            public static int countAll()
493                    throws com.liferay.portal.kernel.exception.SystemException {
494                    return getPersistence().countAll();
495            }
496    
497            public static ResourceActionPersistence getPersistence() {
498                    if (_persistence == null) {
499                            _persistence = (ResourceActionPersistence)PortalBeanLocatorUtil.locate(ResourceActionPersistence.class.getName());
500    
501                            ReferenceRegistry.registerReference(ResourceActionUtil.class,
502                                    "_persistence");
503                    }
504    
505                    return _persistence;
506            }
507    
508            /**
509             * @deprecated As of 6.2.0
510             */
511            public void setPersistence(ResourceActionPersistence persistence) {
512            }
513    
514            private static ResourceActionPersistence _persistence;
515    }