1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="ResourceActionUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class ResourceActionUtil {
32      public static void cacheResult(
33          com.liferay.portal.model.ResourceAction resourceAction) {
34          getPersistence().cacheResult(resourceAction);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portal.model.ResourceAction> resourceActions) {
39          getPersistence().cacheResult(resourceActions);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portal.model.ResourceAction create(
47          long resourceActionId) {
48          return getPersistence().create(resourceActionId);
49      }
50  
51      public static com.liferay.portal.model.ResourceAction remove(
52          long resourceActionId)
53          throws com.liferay.portal.NoSuchResourceActionException,
54              com.liferay.portal.SystemException {
55          return getPersistence().remove(resourceActionId);
56      }
57  
58      public static com.liferay.portal.model.ResourceAction remove(
59          com.liferay.portal.model.ResourceAction resourceAction)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(resourceAction);
62      }
63  
64      /**
65       * @deprecated Use <code>update(ResourceAction resourceAction, boolean merge)</code>.
66       */
67      public static com.liferay.portal.model.ResourceAction update(
68          com.liferay.portal.model.ResourceAction resourceAction)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(resourceAction);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        resourceAction the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when resourceAction is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portal.model.ResourceAction update(
87          com.liferay.portal.model.ResourceAction resourceAction, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().update(resourceAction, merge);
90      }
91  
92      public static com.liferay.portal.model.ResourceAction updateImpl(
93          com.liferay.portal.model.ResourceAction resourceAction, boolean merge)
94          throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(resourceAction, merge);
96      }
97  
98      public static com.liferay.portal.model.ResourceAction findByPrimaryKey(
99          long resourceActionId)
100         throws com.liferay.portal.NoSuchResourceActionException,
101             com.liferay.portal.SystemException {
102         return getPersistence().findByPrimaryKey(resourceActionId);
103     }
104 
105     public static com.liferay.portal.model.ResourceAction fetchByPrimaryKey(
106         long resourceActionId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(resourceActionId);
108     }
109 
110     public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
111         java.lang.String name) throws com.liferay.portal.SystemException {
112         return getPersistence().findByName(name);
113     }
114 
115     public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
116         java.lang.String name, int start, int end)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().findByName(name, start, end);
119     }
120 
121     public static java.util.List<com.liferay.portal.model.ResourceAction> findByName(
122         java.lang.String name, int start, int end,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().findByName(name, start, end, obc);
126     }
127 
128     public static com.liferay.portal.model.ResourceAction findByName_First(
129         java.lang.String name,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.NoSuchResourceActionException,
132             com.liferay.portal.SystemException {
133         return getPersistence().findByName_First(name, obc);
134     }
135 
136     public static com.liferay.portal.model.ResourceAction findByName_Last(
137         java.lang.String name,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.NoSuchResourceActionException,
140             com.liferay.portal.SystemException {
141         return getPersistence().findByName_Last(name, obc);
142     }
143 
144     public static com.liferay.portal.model.ResourceAction[] findByName_PrevAndNext(
145         long resourceActionId, java.lang.String name,
146         com.liferay.portal.kernel.util.OrderByComparator obc)
147         throws com.liferay.portal.NoSuchResourceActionException,
148             com.liferay.portal.SystemException {
149         return getPersistence()
150                    .findByName_PrevAndNext(resourceActionId, name, obc);
151     }
152 
153     public static com.liferay.portal.model.ResourceAction findByN_A(
154         java.lang.String name, java.lang.String actionId)
155         throws com.liferay.portal.NoSuchResourceActionException,
156             com.liferay.portal.SystemException {
157         return getPersistence().findByN_A(name, actionId);
158     }
159 
160     public static com.liferay.portal.model.ResourceAction fetchByN_A(
161         java.lang.String name, java.lang.String actionId)
162         throws com.liferay.portal.SystemException {
163         return getPersistence().fetchByN_A(name, actionId);
164     }
165 
166     public static com.liferay.portal.model.ResourceAction fetchByN_A(
167         java.lang.String name, java.lang.String actionId,
168         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
169         return getPersistence().fetchByN_A(name, actionId, retrieveFromCache);
170     }
171 
172     public static java.util.List<Object> findWithDynamicQuery(
173         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findWithDynamicQuery(dynamicQuery);
176     }
177 
178     public static java.util.List<Object> findWithDynamicQuery(
179         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
180         int end) throws com.liferay.portal.SystemException {
181         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.ResourceAction> findAll()
185         throws com.liferay.portal.SystemException {
186         return getPersistence().findAll();
187     }
188 
189     public static java.util.List<com.liferay.portal.model.ResourceAction> findAll(
190         int start, int end) throws com.liferay.portal.SystemException {
191         return getPersistence().findAll(start, end);
192     }
193 
194     public static java.util.List<com.liferay.portal.model.ResourceAction> findAll(
195         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
196         throws com.liferay.portal.SystemException {
197         return getPersistence().findAll(start, end, obc);
198     }
199 
200     public static void removeByName(java.lang.String name)
201         throws com.liferay.portal.SystemException {
202         getPersistence().removeByName(name);
203     }
204 
205     public static void removeByN_A(java.lang.String name,
206         java.lang.String actionId)
207         throws com.liferay.portal.NoSuchResourceActionException,
208             com.liferay.portal.SystemException {
209         getPersistence().removeByN_A(name, actionId);
210     }
211 
212     public static void removeAll() throws com.liferay.portal.SystemException {
213         getPersistence().removeAll();
214     }
215 
216     public static int countByName(java.lang.String name)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().countByName(name);
219     }
220 
221     public static int countByN_A(java.lang.String name,
222         java.lang.String actionId) throws com.liferay.portal.SystemException {
223         return getPersistence().countByN_A(name, actionId);
224     }
225 
226     public static int countAll() throws com.liferay.portal.SystemException {
227         return getPersistence().countAll();
228     }
229 
230     public static ResourceActionPersistence getPersistence() {
231         return _persistence;
232     }
233 
234     public void setPersistence(ResourceActionPersistence persistence) {
235         _persistence = persistence;
236     }
237 
238     private static ResourceActionPersistence _persistence;
239 }