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  import com.liferay.portal.SystemException;
26  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
27  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
28  import com.liferay.portal.model.ResourcePermission;
29  
30  import java.util.List;
31  
32  /**
33   * <a href="ResourcePermissionUtil.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * @author    Brian Wing Shun Chan
41   * @see       ResourcePermissionPersistence
42   * @see       ResourcePermissionPersistenceImpl
43   * @generated
44   */
45  public class ResourcePermissionUtil {
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
48       */
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
55       */
56      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().findWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
65          int start, int end) throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
71       */
72      public static ResourcePermission remove(
73          ResourcePermission resourcePermission) throws SystemException {
74          return getPersistence().remove(resourcePermission);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
79       */
80      public static ResourcePermission update(
81          ResourcePermission resourcePermission, boolean merge)
82          throws SystemException {
83          return getPersistence().update(resourcePermission, merge);
84      }
85  
86      public static void cacheResult(
87          com.liferay.portal.model.ResourcePermission resourcePermission) {
88          getPersistence().cacheResult(resourcePermission);
89      }
90  
91      public static void cacheResult(
92          java.util.List<com.liferay.portal.model.ResourcePermission> resourcePermissions) {
93          getPersistence().cacheResult(resourcePermissions);
94      }
95  
96      public static com.liferay.portal.model.ResourcePermission create(
97          long resourcePermissionId) {
98          return getPersistence().create(resourcePermissionId);
99      }
100 
101     public static com.liferay.portal.model.ResourcePermission remove(
102         long resourcePermissionId)
103         throws com.liferay.portal.NoSuchResourcePermissionException,
104             com.liferay.portal.SystemException {
105         return getPersistence().remove(resourcePermissionId);
106     }
107 
108     /**
109      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
110      */
111     public static com.liferay.portal.model.ResourcePermission update(
112         com.liferay.portal.model.ResourcePermission resourcePermission)
113         throws com.liferay.portal.SystemException {
114         return getPersistence().update(resourcePermission);
115     }
116 
117     public static com.liferay.portal.model.ResourcePermission updateImpl(
118         com.liferay.portal.model.ResourcePermission resourcePermission,
119         boolean merge) throws com.liferay.portal.SystemException {
120         return getPersistence().updateImpl(resourcePermission, merge);
121     }
122 
123     public static com.liferay.portal.model.ResourcePermission findByPrimaryKey(
124         long resourcePermissionId)
125         throws com.liferay.portal.NoSuchResourcePermissionException,
126             com.liferay.portal.SystemException {
127         return getPersistence().findByPrimaryKey(resourcePermissionId);
128     }
129 
130     public static com.liferay.portal.model.ResourcePermission fetchByPrimaryKey(
131         long resourcePermissionId) throws com.liferay.portal.SystemException {
132         return getPersistence().fetchByPrimaryKey(resourcePermissionId);
133     }
134 
135     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
136         long roleId) throws com.liferay.portal.SystemException {
137         return getPersistence().findByRoleId(roleId);
138     }
139 
140     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
141         long roleId, int start, int end)
142         throws com.liferay.portal.SystemException {
143         return getPersistence().findByRoleId(roleId, start, end);
144     }
145 
146     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
147         long roleId, int start, int end,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.SystemException {
150         return getPersistence().findByRoleId(roleId, start, end, obc);
151     }
152 
153     public static com.liferay.portal.model.ResourcePermission findByRoleId_First(
154         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
155         throws com.liferay.portal.NoSuchResourcePermissionException,
156             com.liferay.portal.SystemException {
157         return getPersistence().findByRoleId_First(roleId, obc);
158     }
159 
160     public static com.liferay.portal.model.ResourcePermission findByRoleId_Last(
161         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.NoSuchResourcePermissionException,
163             com.liferay.portal.SystemException {
164         return getPersistence().findByRoleId_Last(roleId, obc);
165     }
166 
167     public static com.liferay.portal.model.ResourcePermission[] findByRoleId_PrevAndNext(
168         long resourcePermissionId, long roleId,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.NoSuchResourcePermissionException,
171             com.liferay.portal.SystemException {
172         return getPersistence()
173                    .findByRoleId_PrevAndNext(resourcePermissionId, roleId, obc);
174     }
175 
176     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
177         long companyId, java.lang.String name, int scope)
178         throws com.liferay.portal.SystemException {
179         return getPersistence().findByC_N_S(companyId, name, scope);
180     }
181 
182     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
183         long companyId, java.lang.String name, int scope, int start, int end)
184         throws com.liferay.portal.SystemException {
185         return getPersistence().findByC_N_S(companyId, name, scope, start, end);
186     }
187 
188     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
189         long companyId, java.lang.String name, int scope, int start, int end,
190         com.liferay.portal.kernel.util.OrderByComparator obc)
191         throws com.liferay.portal.SystemException {
192         return getPersistence()
193                    .findByC_N_S(companyId, name, scope, start, end, obc);
194     }
195 
196     public static com.liferay.portal.model.ResourcePermission findByC_N_S_First(
197         long companyId, java.lang.String name, int scope,
198         com.liferay.portal.kernel.util.OrderByComparator obc)
199         throws com.liferay.portal.NoSuchResourcePermissionException,
200             com.liferay.portal.SystemException {
201         return getPersistence().findByC_N_S_First(companyId, name, scope, obc);
202     }
203 
204     public static com.liferay.portal.model.ResourcePermission findByC_N_S_Last(
205         long companyId, java.lang.String name, int scope,
206         com.liferay.portal.kernel.util.OrderByComparator obc)
207         throws com.liferay.portal.NoSuchResourcePermissionException,
208             com.liferay.portal.SystemException {
209         return getPersistence().findByC_N_S_Last(companyId, name, scope, obc);
210     }
211 
212     public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_PrevAndNext(
213         long resourcePermissionId, long companyId, java.lang.String name,
214         int scope, com.liferay.portal.kernel.util.OrderByComparator obc)
215         throws com.liferay.portal.NoSuchResourcePermissionException,
216             com.liferay.portal.SystemException {
217         return getPersistence()
218                    .findByC_N_S_PrevAndNext(resourcePermissionId, companyId,
219             name, scope, obc);
220     }
221 
222     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
223         long companyId, java.lang.String name, int scope,
224         java.lang.String primKey) throws com.liferay.portal.SystemException {
225         return getPersistence().findByC_N_S_P(companyId, name, scope, primKey);
226     }
227 
228     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
229         long companyId, java.lang.String name, int scope,
230         java.lang.String primKey, int start, int end)
231         throws com.liferay.portal.SystemException {
232         return getPersistence()
233                    .findByC_N_S_P(companyId, name, scope, primKey, start, end);
234     }
235 
236     public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
237         long companyId, java.lang.String name, int scope,
238         java.lang.String primKey, int start, int end,
239         com.liferay.portal.kernel.util.OrderByComparator obc)
240         throws com.liferay.portal.SystemException {
241         return getPersistence()
242                    .findByC_N_S_P(companyId, name, scope, primKey, start, end,
243             obc);
244     }
245 
246     public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_First(
247         long companyId, java.lang.String name, int scope,
248         java.lang.String primKey,
249         com.liferay.portal.kernel.util.OrderByComparator obc)
250         throws com.liferay.portal.NoSuchResourcePermissionException,
251             com.liferay.portal.SystemException {
252         return getPersistence()
253                    .findByC_N_S_P_First(companyId, name, scope, primKey, obc);
254     }
255 
256     public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_Last(
257         long companyId, java.lang.String name, int scope,
258         java.lang.String primKey,
259         com.liferay.portal.kernel.util.OrderByComparator obc)
260         throws com.liferay.portal.NoSuchResourcePermissionException,
261             com.liferay.portal.SystemException {
262         return getPersistence()
263                    .findByC_N_S_P_Last(companyId, name, scope, primKey, obc);
264     }
265 
266     public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_P_PrevAndNext(
267         long resourcePermissionId, long companyId, java.lang.String name,
268         int scope, java.lang.String primKey,
269         com.liferay.portal.kernel.util.OrderByComparator obc)
270         throws com.liferay.portal.NoSuchResourcePermissionException,
271             com.liferay.portal.SystemException {
272         return getPersistence()
273                    .findByC_N_S_P_PrevAndNext(resourcePermissionId, companyId,
274             name, scope, primKey, obc);
275     }
276 
277     public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_R(
278         long companyId, java.lang.String name, int scope,
279         java.lang.String primKey, long roleId)
280         throws com.liferay.portal.NoSuchResourcePermissionException,
281             com.liferay.portal.SystemException {
282         return getPersistence()
283                    .findByC_N_S_P_R(companyId, name, scope, primKey, roleId);
284     }
285 
286     public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
287         long companyId, java.lang.String name, int scope,
288         java.lang.String primKey, long roleId)
289         throws com.liferay.portal.SystemException {
290         return getPersistence()
291                    .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId);
292     }
293 
294     public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
295         long companyId, java.lang.String name, int scope,
296         java.lang.String primKey, long roleId, boolean retrieveFromCache)
297         throws com.liferay.portal.SystemException {
298         return getPersistence()
299                    .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId,
300             retrieveFromCache);
301     }
302 
303     public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll()
304         throws com.liferay.portal.SystemException {
305         return getPersistence().findAll();
306     }
307 
308     public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
309         int start, int end) throws com.liferay.portal.SystemException {
310         return getPersistence().findAll(start, end);
311     }
312 
313     public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
314         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
315         throws com.liferay.portal.SystemException {
316         return getPersistence().findAll(start, end, obc);
317     }
318 
319     public static void removeByRoleId(long roleId)
320         throws com.liferay.portal.SystemException {
321         getPersistence().removeByRoleId(roleId);
322     }
323 
324     public static void removeByC_N_S(long companyId, java.lang.String name,
325         int scope) throws com.liferay.portal.SystemException {
326         getPersistence().removeByC_N_S(companyId, name, scope);
327     }
328 
329     public static void removeByC_N_S_P(long companyId, java.lang.String name,
330         int scope, java.lang.String primKey)
331         throws com.liferay.portal.SystemException {
332         getPersistence().removeByC_N_S_P(companyId, name, scope, primKey);
333     }
334 
335     public static void removeByC_N_S_P_R(long companyId, java.lang.String name,
336         int scope, java.lang.String primKey, long roleId)
337         throws com.liferay.portal.NoSuchResourcePermissionException,
338             com.liferay.portal.SystemException {
339         getPersistence()
340             .removeByC_N_S_P_R(companyId, name, scope, primKey, roleId);
341     }
342 
343     public static void removeAll() throws com.liferay.portal.SystemException {
344         getPersistence().removeAll();
345     }
346 
347     public static int countByRoleId(long roleId)
348         throws com.liferay.portal.SystemException {
349         return getPersistence().countByRoleId(roleId);
350     }
351 
352     public static int countByC_N_S(long companyId, java.lang.String name,
353         int scope) throws com.liferay.portal.SystemException {
354         return getPersistence().countByC_N_S(companyId, name, scope);
355     }
356 
357     public static int countByC_N_S_P(long companyId, java.lang.String name,
358         int scope, java.lang.String primKey)
359         throws com.liferay.portal.SystemException {
360         return getPersistence().countByC_N_S_P(companyId, name, scope, primKey);
361     }
362 
363     public static int countByC_N_S_P_R(long companyId, java.lang.String name,
364         int scope, java.lang.String primKey, long roleId)
365         throws com.liferay.portal.SystemException {
366         return getPersistence()
367                    .countByC_N_S_P_R(companyId, name, scope, primKey, roleId);
368     }
369 
370     public static int countAll() throws com.liferay.portal.SystemException {
371         return getPersistence().countAll();
372     }
373 
374     public static ResourcePermissionPersistence getPersistence() {
375         if (_persistence == null) {
376             _persistence = (ResourcePermissionPersistence)PortalBeanLocatorUtil.locate(ResourcePermissionPersistence.class.getName());
377         }
378 
379         return _persistence;
380     }
381 
382     public void setPersistence(ResourcePermissionPersistence persistence) {
383         _persistence = persistence;
384     }
385 
386     private static ResourcePermissionPersistence _persistence;
387 }