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