001    /**
002     * Copyright (c) 2000-2012 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            * <p>
249            * 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.
250            * </p>
251            *
252            * @param name the name
253            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
254            * @return the first matching resource action
255            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
256            * @throws SystemException if a system exception occurred
257            */
258            public static com.liferay.portal.model.ResourceAction findByName_First(
259                    java.lang.String name,
260                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
261                    throws com.liferay.portal.NoSuchResourceActionException,
262                            com.liferay.portal.kernel.exception.SystemException {
263                    return getPersistence().findByName_First(name, orderByComparator);
264            }
265    
266            /**
267            * Returns the last resource action in the ordered set where name = &#63;.
268            *
269            * <p>
270            * 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.
271            * </p>
272            *
273            * @param name the name
274            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
275            * @return the last matching resource action
276            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public static com.liferay.portal.model.ResourceAction findByName_Last(
280                    java.lang.String name,
281                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
282                    throws com.liferay.portal.NoSuchResourceActionException,
283                            com.liferay.portal.kernel.exception.SystemException {
284                    return getPersistence().findByName_Last(name, orderByComparator);
285            }
286    
287            /**
288            * Returns the resource actions before and after the current resource action in the ordered set where name = &#63;.
289            *
290            * <p>
291            * 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.
292            * </p>
293            *
294            * @param resourceActionId the primary key of the current resource action
295            * @param name the name
296            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
297            * @return the previous, current, and next resource action
298            * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found
299            * @throws SystemException if a system exception occurred
300            */
301            public static com.liferay.portal.model.ResourceAction[] findByName_PrevAndNext(
302                    long resourceActionId, java.lang.String name,
303                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
304                    throws com.liferay.portal.NoSuchResourceActionException,
305                            com.liferay.portal.kernel.exception.SystemException {
306                    return getPersistence()
307                                       .findByName_PrevAndNext(resourceActionId, name,
308                            orderByComparator);
309            }
310    
311            /**
312            * Returns the resource action where name = &#63; and actionId = &#63; or throws a {@link com.liferay.portal.NoSuchResourceActionException} if it could not be found.
313            *
314            * @param name the name
315            * @param actionId the action ID
316            * @return the matching resource action
317            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
318            * @throws SystemException if a system exception occurred
319            */
320            public static com.liferay.portal.model.ResourceAction findByN_A(
321                    java.lang.String name, java.lang.String actionId)
322                    throws com.liferay.portal.NoSuchResourceActionException,
323                            com.liferay.portal.kernel.exception.SystemException {
324                    return getPersistence().findByN_A(name, actionId);
325            }
326    
327            /**
328            * 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.
329            *
330            * @param name the name
331            * @param actionId the action ID
332            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
333            * @throws SystemException if a system exception occurred
334            */
335            public static com.liferay.portal.model.ResourceAction fetchByN_A(
336                    java.lang.String name, java.lang.String actionId)
337                    throws com.liferay.portal.kernel.exception.SystemException {
338                    return getPersistence().fetchByN_A(name, actionId);
339            }
340    
341            /**
342            * 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.
343            *
344            * @param name the name
345            * @param actionId the action ID
346            * @param retrieveFromCache whether to use the finder cache
347            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
348            * @throws SystemException if a system exception occurred
349            */
350            public static com.liferay.portal.model.ResourceAction fetchByN_A(
351                    java.lang.String name, java.lang.String actionId,
352                    boolean retrieveFromCache)
353                    throws com.liferay.portal.kernel.exception.SystemException {
354                    return getPersistence().fetchByN_A(name, actionId, retrieveFromCache);
355            }
356    
357            /**
358            * Returns all the resource actions.
359            *
360            * @return the resource actions
361            * @throws SystemException if a system exception occurred
362            */
363            public static java.util.List<com.liferay.portal.model.ResourceAction> findAll()
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    return getPersistence().findAll();
366            }
367    
368            /**
369            * Returns a range of all the resource actions.
370            *
371            * <p>
372            * 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.
373            * </p>
374            *
375            * @param start the lower bound of the range of resource actions
376            * @param end the upper bound of the range of resource actions (not inclusive)
377            * @return the range of resource actions
378            * @throws SystemException if a system exception occurred
379            */
380            public static java.util.List<com.liferay.portal.model.ResourceAction> findAll(
381                    int start, int end)
382                    throws com.liferay.portal.kernel.exception.SystemException {
383                    return getPersistence().findAll(start, end);
384            }
385    
386            /**
387            * Returns an ordered 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            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
396            * @return the ordered range of resource actions
397            * @throws SystemException if a system exception occurred
398            */
399            public static java.util.List<com.liferay.portal.model.ResourceAction> findAll(
400                    int start, int end,
401                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
402                    throws com.liferay.portal.kernel.exception.SystemException {
403                    return getPersistence().findAll(start, end, orderByComparator);
404            }
405    
406            /**
407            * Removes all the resource actions where name = &#63; from the database.
408            *
409            * @param name the name
410            * @throws SystemException if a system exception occurred
411            */
412            public static void removeByName(java.lang.String name)
413                    throws com.liferay.portal.kernel.exception.SystemException {
414                    getPersistence().removeByName(name);
415            }
416    
417            /**
418            * Removes the resource action where name = &#63; and actionId = &#63; from the database.
419            *
420            * @param name the name
421            * @param actionId the action ID
422            * @throws SystemException if a system exception occurred
423            */
424            public static void removeByN_A(java.lang.String name,
425                    java.lang.String actionId)
426                    throws com.liferay.portal.NoSuchResourceActionException,
427                            com.liferay.portal.kernel.exception.SystemException {
428                    getPersistence().removeByN_A(name, actionId);
429            }
430    
431            /**
432            * Removes all the resource actions from the database.
433            *
434            * @throws SystemException if a system exception occurred
435            */
436            public static void removeAll()
437                    throws com.liferay.portal.kernel.exception.SystemException {
438                    getPersistence().removeAll();
439            }
440    
441            /**
442            * Returns the number of resource actions where name = &#63;.
443            *
444            * @param name the name
445            * @return the number of matching resource actions
446            * @throws SystemException if a system exception occurred
447            */
448            public static int countByName(java.lang.String name)
449                    throws com.liferay.portal.kernel.exception.SystemException {
450                    return getPersistence().countByName(name);
451            }
452    
453            /**
454            * Returns the number of resource actions where name = &#63; and actionId = &#63;.
455            *
456            * @param name the name
457            * @param actionId the action ID
458            * @return the number of matching resource actions
459            * @throws SystemException if a system exception occurred
460            */
461            public static int countByN_A(java.lang.String name,
462                    java.lang.String actionId)
463                    throws com.liferay.portal.kernel.exception.SystemException {
464                    return getPersistence().countByN_A(name, actionId);
465            }
466    
467            /**
468            * Returns the number of resource actions.
469            *
470            * @return the number of resource actions
471            * @throws SystemException if a system exception occurred
472            */
473            public static int countAll()
474                    throws com.liferay.portal.kernel.exception.SystemException {
475                    return getPersistence().countAll();
476            }
477    
478            public static ResourceActionPersistence getPersistence() {
479                    if (_persistence == null) {
480                            _persistence = (ResourceActionPersistence)PortalBeanLocatorUtil.locate(ResourceActionPersistence.class.getName());
481    
482                            ReferenceRegistry.registerReference(ResourceActionUtil.class,
483                                    "_persistence");
484                    }
485    
486                    return _persistence;
487            }
488    
489            public void setPersistence(ResourceActionPersistence persistence) {
490                    _persistence = persistence;
491    
492                    ReferenceRegistry.registerReference(ResourceActionUtil.class,
493                            "_persistence");
494            }
495    
496            private static ResourceActionPersistence _persistence;
497    }