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