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="RoleUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class RoleUtil {
32      public static void cacheResult(com.liferay.portal.model.Role role) {
33          getPersistence().cacheResult(role);
34      }
35  
36      public static void cacheResult(
37          java.util.List<com.liferay.portal.model.Role> roles) {
38          getPersistence().cacheResult(roles);
39      }
40  
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      public static com.liferay.portal.model.Role create(long roleId) {
46          return getPersistence().create(roleId);
47      }
48  
49      public static com.liferay.portal.model.Role remove(long roleId)
50          throws com.liferay.portal.NoSuchRoleException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(roleId);
53      }
54  
55      public static com.liferay.portal.model.Role remove(
56          com.liferay.portal.model.Role role)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(role);
59      }
60  
61      /**
62       * @deprecated Use <code>update(Role role, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.Role update(
65          com.liferay.portal.model.Role role)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(role);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        role the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when role is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.Role update(
84          com.liferay.portal.model.Role role, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(role, merge);
87      }
88  
89      public static com.liferay.portal.model.Role updateImpl(
90          com.liferay.portal.model.Role role, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(role, merge);
93      }
94  
95      public static com.liferay.portal.model.Role findByPrimaryKey(long roleId)
96          throws com.liferay.portal.NoSuchRoleException,
97              com.liferay.portal.SystemException {
98          return getPersistence().findByPrimaryKey(roleId);
99      }
100 
101     public static com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
102         throws com.liferay.portal.SystemException {
103         return getPersistence().fetchByPrimaryKey(roleId);
104     }
105 
106     public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
107         long companyId) throws com.liferay.portal.SystemException {
108         return getPersistence().findByCompanyId(companyId);
109     }
110 
111     public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
112         long companyId, int start, int end)
113         throws com.liferay.portal.SystemException {
114         return getPersistence().findByCompanyId(companyId, start, end);
115     }
116 
117     public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
118         long companyId, int start, int end,
119         com.liferay.portal.kernel.util.OrderByComparator obc)
120         throws com.liferay.portal.SystemException {
121         return getPersistence().findByCompanyId(companyId, start, end, obc);
122     }
123 
124     public static com.liferay.portal.model.Role findByCompanyId_First(
125         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
126         throws com.liferay.portal.NoSuchRoleException,
127             com.liferay.portal.SystemException {
128         return getPersistence().findByCompanyId_First(companyId, obc);
129     }
130 
131     public static com.liferay.portal.model.Role findByCompanyId_Last(
132         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.NoSuchRoleException,
134             com.liferay.portal.SystemException {
135         return getPersistence().findByCompanyId_Last(companyId, obc);
136     }
137 
138     public static com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
139         long roleId, long companyId,
140         com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.NoSuchRoleException,
142             com.liferay.portal.SystemException {
143         return getPersistence()
144                    .findByCompanyId_PrevAndNext(roleId, companyId, obc);
145     }
146 
147     public static com.liferay.portal.model.Role findByC_N(long companyId,
148         java.lang.String name)
149         throws com.liferay.portal.NoSuchRoleException,
150             com.liferay.portal.SystemException {
151         return getPersistence().findByC_N(companyId, name);
152     }
153 
154     public static com.liferay.portal.model.Role fetchByC_N(long companyId,
155         java.lang.String name) throws com.liferay.portal.SystemException {
156         return getPersistence().fetchByC_N(companyId, name);
157     }
158 
159     public static com.liferay.portal.model.Role fetchByC_N(long companyId,
160         java.lang.String name, boolean retrieveFromCache)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
163     }
164 
165     public static com.liferay.portal.model.Role findByC_C_C(long companyId,
166         long classNameId, long classPK)
167         throws com.liferay.portal.NoSuchRoleException,
168             com.liferay.portal.SystemException {
169         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
170     }
171 
172     public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
173         long classNameId, long classPK)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().fetchByC_C_C(companyId, classNameId, classPK);
176     }
177 
178     public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
179         long classNameId, long classPK, boolean retrieveFromCache)
180         throws com.liferay.portal.SystemException {
181         return getPersistence()
182                    .fetchByC_C_C(companyId, classNameId, classPK,
183             retrieveFromCache);
184     }
185 
186     public static java.util.List<Object> findWithDynamicQuery(
187         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().findWithDynamicQuery(dynamicQuery);
190     }
191 
192     public static java.util.List<Object> findWithDynamicQuery(
193         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
194         int end) throws com.liferay.portal.SystemException {
195         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
196     }
197 
198     public static java.util.List<com.liferay.portal.model.Role> findAll()
199         throws com.liferay.portal.SystemException {
200         return getPersistence().findAll();
201     }
202 
203     public static java.util.List<com.liferay.portal.model.Role> findAll(
204         int start, int end) throws com.liferay.portal.SystemException {
205         return getPersistence().findAll(start, end);
206     }
207 
208     public static java.util.List<com.liferay.portal.model.Role> findAll(
209         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.SystemException {
211         return getPersistence().findAll(start, end, obc);
212     }
213 
214     public static void removeByCompanyId(long companyId)
215         throws com.liferay.portal.SystemException {
216         getPersistence().removeByCompanyId(companyId);
217     }
218 
219     public static void removeByC_N(long companyId, java.lang.String name)
220         throws com.liferay.portal.NoSuchRoleException,
221             com.liferay.portal.SystemException {
222         getPersistence().removeByC_N(companyId, name);
223     }
224 
225     public static void removeByC_C_C(long companyId, long classNameId,
226         long classPK)
227         throws com.liferay.portal.NoSuchRoleException,
228             com.liferay.portal.SystemException {
229         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
230     }
231 
232     public static void removeAll() throws com.liferay.portal.SystemException {
233         getPersistence().removeAll();
234     }
235 
236     public static int countByCompanyId(long companyId)
237         throws com.liferay.portal.SystemException {
238         return getPersistence().countByCompanyId(companyId);
239     }
240 
241     public static int countByC_N(long companyId, java.lang.String name)
242         throws com.liferay.portal.SystemException {
243         return getPersistence().countByC_N(companyId, name);
244     }
245 
246     public static int countByC_C_C(long companyId, long classNameId,
247         long classPK) throws com.liferay.portal.SystemException {
248         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
249     }
250 
251     public static int countAll() throws com.liferay.portal.SystemException {
252         return getPersistence().countAll();
253     }
254 
255     public static java.util.List<com.liferay.portal.model.Group> getGroups(
256         long pk) throws com.liferay.portal.SystemException {
257         return getPersistence().getGroups(pk);
258     }
259 
260     public static java.util.List<com.liferay.portal.model.Group> getGroups(
261         long pk, int start, int end) throws com.liferay.portal.SystemException {
262         return getPersistence().getGroups(pk, start, end);
263     }
264 
265     public static java.util.List<com.liferay.portal.model.Group> getGroups(
266         long pk, int start, int end,
267         com.liferay.portal.kernel.util.OrderByComparator obc)
268         throws com.liferay.portal.SystemException {
269         return getPersistence().getGroups(pk, start, end, obc);
270     }
271 
272     public static int getGroupsSize(long pk)
273         throws com.liferay.portal.SystemException {
274         return getPersistence().getGroupsSize(pk);
275     }
276 
277     public static boolean containsGroup(long pk, long groupPK)
278         throws com.liferay.portal.SystemException {
279         return getPersistence().containsGroup(pk, groupPK);
280     }
281 
282     public static boolean containsGroups(long pk)
283         throws com.liferay.portal.SystemException {
284         return getPersistence().containsGroups(pk);
285     }
286 
287     public static void addGroup(long pk, long groupPK)
288         throws com.liferay.portal.SystemException {
289         getPersistence().addGroup(pk, groupPK);
290     }
291 
292     public static void addGroup(long pk, com.liferay.portal.model.Group group)
293         throws com.liferay.portal.SystemException {
294         getPersistence().addGroup(pk, group);
295     }
296 
297     public static void addGroups(long pk, long[] groupPKs)
298         throws com.liferay.portal.SystemException {
299         getPersistence().addGroups(pk, groupPKs);
300     }
301 
302     public static void addGroups(long pk,
303         java.util.List<com.liferay.portal.model.Group> groups)
304         throws com.liferay.portal.SystemException {
305         getPersistence().addGroups(pk, groups);
306     }
307 
308     public static void clearGroups(long pk)
309         throws com.liferay.portal.SystemException {
310         getPersistence().clearGroups(pk);
311     }
312 
313     public static void removeGroup(long pk, long groupPK)
314         throws com.liferay.portal.SystemException {
315         getPersistence().removeGroup(pk, groupPK);
316     }
317 
318     public static void removeGroup(long pk, com.liferay.portal.model.Group group)
319         throws com.liferay.portal.SystemException {
320         getPersistence().removeGroup(pk, group);
321     }
322 
323     public static void removeGroups(long pk, long[] groupPKs)
324         throws com.liferay.portal.SystemException {
325         getPersistence().removeGroups(pk, groupPKs);
326     }
327 
328     public static void removeGroups(long pk,
329         java.util.List<com.liferay.portal.model.Group> groups)
330         throws com.liferay.portal.SystemException {
331         getPersistence().removeGroups(pk, groups);
332     }
333 
334     public static void setGroups(long pk, long[] groupPKs)
335         throws com.liferay.portal.SystemException {
336         getPersistence().setGroups(pk, groupPKs);
337     }
338 
339     public static void setGroups(long pk,
340         java.util.List<com.liferay.portal.model.Group> groups)
341         throws com.liferay.portal.SystemException {
342         getPersistence().setGroups(pk, groups);
343     }
344 
345     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
346         long pk) throws com.liferay.portal.SystemException {
347         return getPersistence().getPermissions(pk);
348     }
349 
350     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
351         long pk, int start, int end) throws com.liferay.portal.SystemException {
352         return getPersistence().getPermissions(pk, start, end);
353     }
354 
355     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
356         long pk, int start, int end,
357         com.liferay.portal.kernel.util.OrderByComparator obc)
358         throws com.liferay.portal.SystemException {
359         return getPersistence().getPermissions(pk, start, end, obc);
360     }
361 
362     public static int getPermissionsSize(long pk)
363         throws com.liferay.portal.SystemException {
364         return getPersistence().getPermissionsSize(pk);
365     }
366 
367     public static boolean containsPermission(long pk, long permissionPK)
368         throws com.liferay.portal.SystemException {
369         return getPersistence().containsPermission(pk, permissionPK);
370     }
371 
372     public static boolean containsPermissions(long pk)
373         throws com.liferay.portal.SystemException {
374         return getPersistence().containsPermissions(pk);
375     }
376 
377     public static void addPermission(long pk, long permissionPK)
378         throws com.liferay.portal.SystemException {
379         getPersistence().addPermission(pk, permissionPK);
380     }
381 
382     public static void addPermission(long pk,
383         com.liferay.portal.model.Permission permission)
384         throws com.liferay.portal.SystemException {
385         getPersistence().addPermission(pk, permission);
386     }
387 
388     public static void addPermissions(long pk, long[] permissionPKs)
389         throws com.liferay.portal.SystemException {
390         getPersistence().addPermissions(pk, permissionPKs);
391     }
392 
393     public static void addPermissions(long pk,
394         java.util.List<com.liferay.portal.model.Permission> permissions)
395         throws com.liferay.portal.SystemException {
396         getPersistence().addPermissions(pk, permissions);
397     }
398 
399     public static void clearPermissions(long pk)
400         throws com.liferay.portal.SystemException {
401         getPersistence().clearPermissions(pk);
402     }
403 
404     public static void removePermission(long pk, long permissionPK)
405         throws com.liferay.portal.SystemException {
406         getPersistence().removePermission(pk, permissionPK);
407     }
408 
409     public static void removePermission(long pk,
410         com.liferay.portal.model.Permission permission)
411         throws com.liferay.portal.SystemException {
412         getPersistence().removePermission(pk, permission);
413     }
414 
415     public static void removePermissions(long pk, long[] permissionPKs)
416         throws com.liferay.portal.SystemException {
417         getPersistence().removePermissions(pk, permissionPKs);
418     }
419 
420     public static void removePermissions(long pk,
421         java.util.List<com.liferay.portal.model.Permission> permissions)
422         throws com.liferay.portal.SystemException {
423         getPersistence().removePermissions(pk, permissions);
424     }
425 
426     public static void setPermissions(long pk, long[] permissionPKs)
427         throws com.liferay.portal.SystemException {
428         getPersistence().setPermissions(pk, permissionPKs);
429     }
430 
431     public static void setPermissions(long pk,
432         java.util.List<com.liferay.portal.model.Permission> permissions)
433         throws com.liferay.portal.SystemException {
434         getPersistence().setPermissions(pk, permissions);
435     }
436 
437     public static java.util.List<com.liferay.portal.model.User> getUsers(
438         long pk) throws com.liferay.portal.SystemException {
439         return getPersistence().getUsers(pk);
440     }
441 
442     public static java.util.List<com.liferay.portal.model.User> getUsers(
443         long pk, int start, int end) throws com.liferay.portal.SystemException {
444         return getPersistence().getUsers(pk, start, end);
445     }
446 
447     public static java.util.List<com.liferay.portal.model.User> getUsers(
448         long pk, int start, int end,
449         com.liferay.portal.kernel.util.OrderByComparator obc)
450         throws com.liferay.portal.SystemException {
451         return getPersistence().getUsers(pk, start, end, obc);
452     }
453 
454     public static int getUsersSize(long pk)
455         throws com.liferay.portal.SystemException {
456         return getPersistence().getUsersSize(pk);
457     }
458 
459     public static boolean containsUser(long pk, long userPK)
460         throws com.liferay.portal.SystemException {
461         return getPersistence().containsUser(pk, userPK);
462     }
463 
464     public static boolean containsUsers(long pk)
465         throws com.liferay.portal.SystemException {
466         return getPersistence().containsUsers(pk);
467     }
468 
469     public static void addUser(long pk, long userPK)
470         throws com.liferay.portal.SystemException {
471         getPersistence().addUser(pk, userPK);
472     }
473 
474     public static void addUser(long pk, com.liferay.portal.model.User user)
475         throws com.liferay.portal.SystemException {
476         getPersistence().addUser(pk, user);
477     }
478 
479     public static void addUsers(long pk, long[] userPKs)
480         throws com.liferay.portal.SystemException {
481         getPersistence().addUsers(pk, userPKs);
482     }
483 
484     public static void addUsers(long pk,
485         java.util.List<com.liferay.portal.model.User> users)
486         throws com.liferay.portal.SystemException {
487         getPersistence().addUsers(pk, users);
488     }
489 
490     public static void clearUsers(long pk)
491         throws com.liferay.portal.SystemException {
492         getPersistence().clearUsers(pk);
493     }
494 
495     public static void removeUser(long pk, long userPK)
496         throws com.liferay.portal.SystemException {
497         getPersistence().removeUser(pk, userPK);
498     }
499 
500     public static void removeUser(long pk, com.liferay.portal.model.User user)
501         throws com.liferay.portal.SystemException {
502         getPersistence().removeUser(pk, user);
503     }
504 
505     public static void removeUsers(long pk, long[] userPKs)
506         throws com.liferay.portal.SystemException {
507         getPersistence().removeUsers(pk, userPKs);
508     }
509 
510     public static void removeUsers(long pk,
511         java.util.List<com.liferay.portal.model.User> users)
512         throws com.liferay.portal.SystemException {
513         getPersistence().removeUsers(pk, users);
514     }
515 
516     public static void setUsers(long pk, long[] userPKs)
517         throws com.liferay.portal.SystemException {
518         getPersistence().setUsers(pk, userPKs);
519     }
520 
521     public static void setUsers(long pk,
522         java.util.List<com.liferay.portal.model.User> users)
523         throws com.liferay.portal.SystemException {
524         getPersistence().setUsers(pk, users);
525     }
526 
527     public static RolePersistence getPersistence() {
528         return _persistence;
529     }
530 
531     public void setPersistence(RolePersistence persistence) {
532         _persistence = persistence;
533     }
534 
535     private static RolePersistence _persistence;
536 }