001    /**
002     * Copyright (c) 2000-2010 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.model.ResourceAction;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the resource action service.
028     *
029     * <p>
030     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
031     * </p>
032     *
033     * @author Brian Wing Shun Chan
034     * @see ResourceActionPersistence
035     * @see ResourceActionPersistenceImpl
036     * @generated
037     */
038    public class ResourceActionUtil {
039            /**
040             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
041             */
042            public static void clearCache() {
043                    getPersistence().clearCache();
044            }
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
048             */
049            public static void clearCache(ResourceAction resourceAction) {
050                    getPersistence().clearCache(resourceAction);
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
055             */
056            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
057                    throws SystemException {
058                    return getPersistence().countWithDynamicQuery(dynamicQuery);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
063             */
064            public static List<ResourceAction> findWithDynamicQuery(
065                    DynamicQuery dynamicQuery) throws SystemException {
066                    return getPersistence().findWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
071             */
072            public static List<ResourceAction> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery, int start, int end)
074                    throws SystemException {
075                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
076            }
077    
078            /**
079             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
080             */
081            public static List<ResourceAction> findWithDynamicQuery(
082                    DynamicQuery dynamicQuery, int start, int end,
083                    OrderByComparator orderByComparator) throws SystemException {
084                    return getPersistence()
085                                       .findWithDynamicQuery(dynamicQuery, start, end,
086                            orderByComparator);
087            }
088    
089            /**
090             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
091             */
092            public static ResourceAction remove(ResourceAction resourceAction)
093                    throws SystemException {
094                    return getPersistence().remove(resourceAction);
095            }
096    
097            /**
098             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
099             */
100            public static ResourceAction update(ResourceAction resourceAction,
101                    boolean merge) throws SystemException {
102                    return getPersistence().update(resourceAction, merge);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
107             */
108            public static ResourceAction update(ResourceAction resourceAction,
109                    boolean merge, ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(resourceAction, merge, serviceContext);
111            }
112    
113            /**
114            * Caches the resource action in the entity cache if it is enabled.
115            *
116            * @param resourceAction the resource action to cache
117            */
118            public static void cacheResult(
119                    com.liferay.portal.model.ResourceAction resourceAction) {
120                    getPersistence().cacheResult(resourceAction);
121            }
122    
123            /**
124            * Caches the resource actions in the entity cache if it is enabled.
125            *
126            * @param resourceActions the resource actions to cache
127            */
128            public static void cacheResult(
129                    java.util.List<com.liferay.portal.model.ResourceAction> resourceActions) {
130                    getPersistence().cacheResult(resourceActions);
131            }
132    
133            /**
134            * Creates a new resource action with the primary key.
135            *
136            * @param resourceActionId the primary key for the new resource action
137            * @return the new resource action
138            */
139            public static com.liferay.portal.model.ResourceAction create(
140                    long resourceActionId) {
141                    return getPersistence().create(resourceActionId);
142            }
143    
144            /**
145            * Removes the resource action with the primary key from the database. Also notifies the appropriate model listeners.
146            *
147            * @param resourceActionId the primary key of the resource action to remove
148            * @return the resource action that was removed
149            * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found
150            * @throws SystemException if a system exception occurred
151            */
152            public static com.liferay.portal.model.ResourceAction remove(
153                    long resourceActionId)
154                    throws com.liferay.portal.NoSuchResourceActionException,
155                            com.liferay.portal.kernel.exception.SystemException {
156                    return getPersistence().remove(resourceActionId);
157            }
158    
159            public static com.liferay.portal.model.ResourceAction updateImpl(
160                    com.liferay.portal.model.ResourceAction resourceAction, boolean merge)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().updateImpl(resourceAction, merge);
163            }
164    
165            /**
166            * Finds the resource action with the primary key or throws a {@link com.liferay.portal.NoSuchResourceActionException} if it could not be found.
167            *
168            * @param resourceActionId the primary key of the resource action to find
169            * @return the resource action
170            * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found
171            * @throws SystemException if a system exception occurred
172            */
173            public static com.liferay.portal.model.ResourceAction findByPrimaryKey(
174                    long resourceActionId)
175                    throws com.liferay.portal.NoSuchResourceActionException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    return getPersistence().findByPrimaryKey(resourceActionId);
178            }
179    
180            /**
181            * Finds the resource action with the primary key or returns <code>null</code> if it could not be found.
182            *
183            * @param resourceActionId the primary key of the resource action to find
184            * @return the resource action, or <code>null</code> if a resource action with the primary key could not be found
185            * @throws SystemException if a system exception occurred
186            */
187            public static com.liferay.portal.model.ResourceAction fetchByPrimaryKey(
188                    long resourceActionId)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(resourceActionId);
191            }
192    
193            /**
194            * Finds all the resource actions where name = &#63;.
195            *
196            * @param name the name to search with
197            * @return the matching resource actions
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
201                    java.lang.String name)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByName(name);
204            }
205    
206            /**
207            * Finds a range of all the resource actions where name = &#63;.
208            *
209            * <p>
210            * 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.
211            * </p>
212            *
213            * @param name the name to search with
214            * @param start the lower bound of the range of resource actions to return
215            * @param end the upper bound of the range of resource actions to return (not inclusive)
216            * @return the range of matching resource actions
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
220                    java.lang.String name, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByName(name, start, end);
223            }
224    
225            /**
226            * Finds an ordered range of all the resource actions where name = &#63;.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param name the name to search with
233            * @param start the lower bound of the range of resource actions to return
234            * @param end the upper bound of the range of resource actions to return (not inclusive)
235            * @param orderByComparator the comparator to order the results by
236            * @return the ordered range of matching resource actions
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
240                    java.lang.String name, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence().findByName(name, start, end, orderByComparator);
244            }
245    
246            /**
247            * Finds the first resource action in the ordered set where name = &#63;.
248            *
249            * <p>
250            * 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.
251            * </p>
252            *
253            * @param name the name to search with
254            * @param orderByComparator the comparator to order the set by
255            * @return the first matching resource action
256            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
257            * @throws SystemException if a system exception occurred
258            */
259            public static com.liferay.portal.model.ResourceAction findByName_First(
260                    java.lang.String name,
261                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
262                    throws com.liferay.portal.NoSuchResourceActionException,
263                            com.liferay.portal.kernel.exception.SystemException {
264                    return getPersistence().findByName_First(name, orderByComparator);
265            }
266    
267            /**
268            * Finds the last resource action in the ordered set where name = &#63;.
269            *
270            * <p>
271            * 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.
272            * </p>
273            *
274            * @param name the name to search with
275            * @param orderByComparator the comparator to order the set by
276            * @return the last matching resource action
277            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
278            * @throws SystemException if a system exception occurred
279            */
280            public static com.liferay.portal.model.ResourceAction findByName_Last(
281                    java.lang.String name,
282                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
283                    throws com.liferay.portal.NoSuchResourceActionException,
284                            com.liferay.portal.kernel.exception.SystemException {
285                    return getPersistence().findByName_Last(name, orderByComparator);
286            }
287    
288            /**
289            * Finds the resource actions before and after the current resource action in the ordered set where name = &#63;.
290            *
291            * <p>
292            * 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.
293            * </p>
294            *
295            * @param resourceActionId the primary key of the current resource action
296            * @param name the name to search with
297            * @param orderByComparator the comparator to order the set by
298            * @return the previous, current, and next resource action
299            * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found
300            * @throws SystemException if a system exception occurred
301            */
302            public static com.liferay.portal.model.ResourceAction[] findByName_PrevAndNext(
303                    long resourceActionId, java.lang.String name,
304                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
305                    throws com.liferay.portal.NoSuchResourceActionException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    return getPersistence()
308                                       .findByName_PrevAndNext(resourceActionId, name,
309                            orderByComparator);
310            }
311    
312            /**
313            * Finds the resource action where name = &#63; and actionId = &#63; or throws a {@link com.liferay.portal.NoSuchResourceActionException} if it could not be found.
314            *
315            * @param name the name to search with
316            * @param actionId the action id to search with
317            * @return the matching resource action
318            * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found
319            * @throws SystemException if a system exception occurred
320            */
321            public static com.liferay.portal.model.ResourceAction findByN_A(
322                    java.lang.String name, java.lang.String actionId)
323                    throws com.liferay.portal.NoSuchResourceActionException,
324                            com.liferay.portal.kernel.exception.SystemException {
325                    return getPersistence().findByN_A(name, actionId);
326            }
327    
328            /**
329            * Finds the resource action where name = &#63; and actionId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
330            *
331            * @param name the name to search with
332            * @param actionId the action id to search with
333            * @return the matching resource action, or <code>null</code> if a matching resource action could not be found
334            * @throws SystemException if a system exception occurred
335            */
336            public static com.liferay.portal.model.ResourceAction fetchByN_A(
337                    java.lang.String name, java.lang.String actionId)
338                    throws com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().fetchByN_A(name, actionId);
340            }
341    
342            /**
343            * Finds 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.
344            *
345            * @param name the name to search with
346            * @param actionId the action id to search with
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            * Finds 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            * Finds 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 to return
376            * @param end the upper bound of the range of resource actions to return (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            * Finds 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 to return
394            * @param end the upper bound of the range of resource actions to return (not inclusive)
395            * @param orderByComparator the comparator to order the results by
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 to search with
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 to search with
421            * @param actionId the action id to search with
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            * Counts all the resource actions where name = &#63;.
443            *
444            * @param name the name to search with
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            * Counts all the resource actions where name = &#63; and actionId = &#63;.
455            *
456            * @param name the name to search with
457            * @param actionId the action id to search with
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            * Counts all the 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    
483                    return _persistence;
484            }
485    
486            public void setPersistence(ResourceActionPersistence persistence) {
487                    _persistence = persistence;
488            }
489    
490            private static ResourceActionPersistence _persistence;
491    }