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 java.util.List<com.liferay.portal.model.Role> findByT_S(
166         int type, java.lang.String subtype)
167         throws com.liferay.portal.SystemException {
168         return getPersistence().findByT_S(type, subtype);
169     }
170 
171     public static java.util.List<com.liferay.portal.model.Role> findByT_S(
172         int type, java.lang.String subtype, int start, int end)
173         throws com.liferay.portal.SystemException {
174         return getPersistence().findByT_S(type, subtype, start, end);
175     }
176 
177     public static java.util.List<com.liferay.portal.model.Role> findByT_S(
178         int type, java.lang.String subtype, int start, int end,
179         com.liferay.portal.kernel.util.OrderByComparator obc)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().findByT_S(type, subtype, start, end, obc);
182     }
183 
184     public static com.liferay.portal.model.Role findByT_S_First(int type,
185         java.lang.String subtype,
186         com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.NoSuchRoleException,
188             com.liferay.portal.SystemException {
189         return getPersistence().findByT_S_First(type, subtype, obc);
190     }
191 
192     public static com.liferay.portal.model.Role findByT_S_Last(int type,
193         java.lang.String subtype,
194         com.liferay.portal.kernel.util.OrderByComparator obc)
195         throws com.liferay.portal.NoSuchRoleException,
196             com.liferay.portal.SystemException {
197         return getPersistence().findByT_S_Last(type, subtype, obc);
198     }
199 
200     public static com.liferay.portal.model.Role[] findByT_S_PrevAndNext(
201         long roleId, int type, java.lang.String subtype,
202         com.liferay.portal.kernel.util.OrderByComparator obc)
203         throws com.liferay.portal.NoSuchRoleException,
204             com.liferay.portal.SystemException {
205         return getPersistence().findByT_S_PrevAndNext(roleId, type, subtype, obc);
206     }
207 
208     public static com.liferay.portal.model.Role findByC_C_C(long companyId,
209         long classNameId, long classPK)
210         throws com.liferay.portal.NoSuchRoleException,
211             com.liferay.portal.SystemException {
212         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
213     }
214 
215     public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
216         long classNameId, long classPK)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().fetchByC_C_C(companyId, classNameId, classPK);
219     }
220 
221     public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
222         long classNameId, long classPK, boolean retrieveFromCache)
223         throws com.liferay.portal.SystemException {
224         return getPersistence()
225                    .fetchByC_C_C(companyId, classNameId, classPK,
226             retrieveFromCache);
227     }
228 
229     public static java.util.List<Object> findWithDynamicQuery(
230         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
231         throws com.liferay.portal.SystemException {
232         return getPersistence().findWithDynamicQuery(dynamicQuery);
233     }
234 
235     public static java.util.List<Object> findWithDynamicQuery(
236         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
237         int end) throws com.liferay.portal.SystemException {
238         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
239     }
240 
241     public static java.util.List<com.liferay.portal.model.Role> findAll()
242         throws com.liferay.portal.SystemException {
243         return getPersistence().findAll();
244     }
245 
246     public static java.util.List<com.liferay.portal.model.Role> findAll(
247         int start, int end) throws com.liferay.portal.SystemException {
248         return getPersistence().findAll(start, end);
249     }
250 
251     public static java.util.List<com.liferay.portal.model.Role> findAll(
252         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
253         throws com.liferay.portal.SystemException {
254         return getPersistence().findAll(start, end, obc);
255     }
256 
257     public static void removeByCompanyId(long companyId)
258         throws com.liferay.portal.SystemException {
259         getPersistence().removeByCompanyId(companyId);
260     }
261 
262     public static void removeByC_N(long companyId, java.lang.String name)
263         throws com.liferay.portal.NoSuchRoleException,
264             com.liferay.portal.SystemException {
265         getPersistence().removeByC_N(companyId, name);
266     }
267 
268     public static void removeByT_S(int type, java.lang.String subtype)
269         throws com.liferay.portal.SystemException {
270         getPersistence().removeByT_S(type, subtype);
271     }
272 
273     public static void removeByC_C_C(long companyId, long classNameId,
274         long classPK)
275         throws com.liferay.portal.NoSuchRoleException,
276             com.liferay.portal.SystemException {
277         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
278     }
279 
280     public static void removeAll() throws com.liferay.portal.SystemException {
281         getPersistence().removeAll();
282     }
283 
284     public static int countByCompanyId(long companyId)
285         throws com.liferay.portal.SystemException {
286         return getPersistence().countByCompanyId(companyId);
287     }
288 
289     public static int countByC_N(long companyId, java.lang.String name)
290         throws com.liferay.portal.SystemException {
291         return getPersistence().countByC_N(companyId, name);
292     }
293 
294     public static int countByT_S(int type, java.lang.String subtype)
295         throws com.liferay.portal.SystemException {
296         return getPersistence().countByT_S(type, subtype);
297     }
298 
299     public static int countByC_C_C(long companyId, long classNameId,
300         long classPK) throws com.liferay.portal.SystemException {
301         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
302     }
303 
304     public static int countAll() throws com.liferay.portal.SystemException {
305         return getPersistence().countAll();
306     }
307 
308     public static java.util.List<com.liferay.portal.model.Group> getGroups(
309         long pk) throws com.liferay.portal.SystemException {
310         return getPersistence().getGroups(pk);
311     }
312 
313     public static java.util.List<com.liferay.portal.model.Group> getGroups(
314         long pk, int start, int end) throws com.liferay.portal.SystemException {
315         return getPersistence().getGroups(pk, start, end);
316     }
317 
318     public static java.util.List<com.liferay.portal.model.Group> getGroups(
319         long pk, int start, int end,
320         com.liferay.portal.kernel.util.OrderByComparator obc)
321         throws com.liferay.portal.SystemException {
322         return getPersistence().getGroups(pk, start, end, obc);
323     }
324 
325     public static int getGroupsSize(long pk)
326         throws com.liferay.portal.SystemException {
327         return getPersistence().getGroupsSize(pk);
328     }
329 
330     public static boolean containsGroup(long pk, long groupPK)
331         throws com.liferay.portal.SystemException {
332         return getPersistence().containsGroup(pk, groupPK);
333     }
334 
335     public static boolean containsGroups(long pk)
336         throws com.liferay.portal.SystemException {
337         return getPersistence().containsGroups(pk);
338     }
339 
340     public static void addGroup(long pk, long groupPK)
341         throws com.liferay.portal.SystemException {
342         getPersistence().addGroup(pk, groupPK);
343     }
344 
345     public static void addGroup(long pk, com.liferay.portal.model.Group group)
346         throws com.liferay.portal.SystemException {
347         getPersistence().addGroup(pk, group);
348     }
349 
350     public static void addGroups(long pk, long[] groupPKs)
351         throws com.liferay.portal.SystemException {
352         getPersistence().addGroups(pk, groupPKs);
353     }
354 
355     public static void addGroups(long pk,
356         java.util.List<com.liferay.portal.model.Group> groups)
357         throws com.liferay.portal.SystemException {
358         getPersistence().addGroups(pk, groups);
359     }
360 
361     public static void clearGroups(long pk)
362         throws com.liferay.portal.SystemException {
363         getPersistence().clearGroups(pk);
364     }
365 
366     public static void removeGroup(long pk, long groupPK)
367         throws com.liferay.portal.SystemException {
368         getPersistence().removeGroup(pk, groupPK);
369     }
370 
371     public static void removeGroup(long pk, com.liferay.portal.model.Group group)
372         throws com.liferay.portal.SystemException {
373         getPersistence().removeGroup(pk, group);
374     }
375 
376     public static void removeGroups(long pk, long[] groupPKs)
377         throws com.liferay.portal.SystemException {
378         getPersistence().removeGroups(pk, groupPKs);
379     }
380 
381     public static void removeGroups(long pk,
382         java.util.List<com.liferay.portal.model.Group> groups)
383         throws com.liferay.portal.SystemException {
384         getPersistence().removeGroups(pk, groups);
385     }
386 
387     public static void setGroups(long pk, long[] groupPKs)
388         throws com.liferay.portal.SystemException {
389         getPersistence().setGroups(pk, groupPKs);
390     }
391 
392     public static void setGroups(long pk,
393         java.util.List<com.liferay.portal.model.Group> groups)
394         throws com.liferay.portal.SystemException {
395         getPersistence().setGroups(pk, groups);
396     }
397 
398     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
399         long pk) throws com.liferay.portal.SystemException {
400         return getPersistence().getPermissions(pk);
401     }
402 
403     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
404         long pk, int start, int end) throws com.liferay.portal.SystemException {
405         return getPersistence().getPermissions(pk, start, end);
406     }
407 
408     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
409         long pk, int start, int end,
410         com.liferay.portal.kernel.util.OrderByComparator obc)
411         throws com.liferay.portal.SystemException {
412         return getPersistence().getPermissions(pk, start, end, obc);
413     }
414 
415     public static int getPermissionsSize(long pk)
416         throws com.liferay.portal.SystemException {
417         return getPersistence().getPermissionsSize(pk);
418     }
419 
420     public static boolean containsPermission(long pk, long permissionPK)
421         throws com.liferay.portal.SystemException {
422         return getPersistence().containsPermission(pk, permissionPK);
423     }
424 
425     public static boolean containsPermissions(long pk)
426         throws com.liferay.portal.SystemException {
427         return getPersistence().containsPermissions(pk);
428     }
429 
430     public static void addPermission(long pk, long permissionPK)
431         throws com.liferay.portal.SystemException {
432         getPersistence().addPermission(pk, permissionPK);
433     }
434 
435     public static void addPermission(long pk,
436         com.liferay.portal.model.Permission permission)
437         throws com.liferay.portal.SystemException {
438         getPersistence().addPermission(pk, permission);
439     }
440 
441     public static void addPermissions(long pk, long[] permissionPKs)
442         throws com.liferay.portal.SystemException {
443         getPersistence().addPermissions(pk, permissionPKs);
444     }
445 
446     public static void addPermissions(long pk,
447         java.util.List<com.liferay.portal.model.Permission> permissions)
448         throws com.liferay.portal.SystemException {
449         getPersistence().addPermissions(pk, permissions);
450     }
451 
452     public static void clearPermissions(long pk)
453         throws com.liferay.portal.SystemException {
454         getPersistence().clearPermissions(pk);
455     }
456 
457     public static void removePermission(long pk, long permissionPK)
458         throws com.liferay.portal.SystemException {
459         getPersistence().removePermission(pk, permissionPK);
460     }
461 
462     public static void removePermission(long pk,
463         com.liferay.portal.model.Permission permission)
464         throws com.liferay.portal.SystemException {
465         getPersistence().removePermission(pk, permission);
466     }
467 
468     public static void removePermissions(long pk, long[] permissionPKs)
469         throws com.liferay.portal.SystemException {
470         getPersistence().removePermissions(pk, permissionPKs);
471     }
472 
473     public static void removePermissions(long pk,
474         java.util.List<com.liferay.portal.model.Permission> permissions)
475         throws com.liferay.portal.SystemException {
476         getPersistence().removePermissions(pk, permissions);
477     }
478 
479     public static void setPermissions(long pk, long[] permissionPKs)
480         throws com.liferay.portal.SystemException {
481         getPersistence().setPermissions(pk, permissionPKs);
482     }
483 
484     public static void setPermissions(long pk,
485         java.util.List<com.liferay.portal.model.Permission> permissions)
486         throws com.liferay.portal.SystemException {
487         getPersistence().setPermissions(pk, permissions);
488     }
489 
490     public static java.util.List<com.liferay.portal.model.User> getUsers(
491         long pk) throws com.liferay.portal.SystemException {
492         return getPersistence().getUsers(pk);
493     }
494 
495     public static java.util.List<com.liferay.portal.model.User> getUsers(
496         long pk, int start, int end) throws com.liferay.portal.SystemException {
497         return getPersistence().getUsers(pk, start, end);
498     }
499 
500     public static java.util.List<com.liferay.portal.model.User> getUsers(
501         long pk, int start, int end,
502         com.liferay.portal.kernel.util.OrderByComparator obc)
503         throws com.liferay.portal.SystemException {
504         return getPersistence().getUsers(pk, start, end, obc);
505     }
506 
507     public static int getUsersSize(long pk)
508         throws com.liferay.portal.SystemException {
509         return getPersistence().getUsersSize(pk);
510     }
511 
512     public static boolean containsUser(long pk, long userPK)
513         throws com.liferay.portal.SystemException {
514         return getPersistence().containsUser(pk, userPK);
515     }
516 
517     public static boolean containsUsers(long pk)
518         throws com.liferay.portal.SystemException {
519         return getPersistence().containsUsers(pk);
520     }
521 
522     public static void addUser(long pk, long userPK)
523         throws com.liferay.portal.SystemException {
524         getPersistence().addUser(pk, userPK);
525     }
526 
527     public static void addUser(long pk, com.liferay.portal.model.User user)
528         throws com.liferay.portal.SystemException {
529         getPersistence().addUser(pk, user);
530     }
531 
532     public static void addUsers(long pk, long[] userPKs)
533         throws com.liferay.portal.SystemException {
534         getPersistence().addUsers(pk, userPKs);
535     }
536 
537     public static void addUsers(long pk,
538         java.util.List<com.liferay.portal.model.User> users)
539         throws com.liferay.portal.SystemException {
540         getPersistence().addUsers(pk, users);
541     }
542 
543     public static void clearUsers(long pk)
544         throws com.liferay.portal.SystemException {
545         getPersistence().clearUsers(pk);
546     }
547 
548     public static void removeUser(long pk, long userPK)
549         throws com.liferay.portal.SystemException {
550         getPersistence().removeUser(pk, userPK);
551     }
552 
553     public static void removeUser(long pk, com.liferay.portal.model.User user)
554         throws com.liferay.portal.SystemException {
555         getPersistence().removeUser(pk, user);
556     }
557 
558     public static void removeUsers(long pk, long[] userPKs)
559         throws com.liferay.portal.SystemException {
560         getPersistence().removeUsers(pk, userPKs);
561     }
562 
563     public static void removeUsers(long pk,
564         java.util.List<com.liferay.portal.model.User> users)
565         throws com.liferay.portal.SystemException {
566         getPersistence().removeUsers(pk, users);
567     }
568 
569     public static void setUsers(long pk, long[] userPKs)
570         throws com.liferay.portal.SystemException {
571         getPersistence().setUsers(pk, userPKs);
572     }
573 
574     public static void setUsers(long pk,
575         java.util.List<com.liferay.portal.model.User> users)
576         throws com.liferay.portal.SystemException {
577         getPersistence().setUsers(pk, users);
578     }
579 
580     public static RolePersistence getPersistence() {
581         return _persistence;
582     }
583 
584     public void setPersistence(RolePersistence persistence) {
585         _persistence = persistence;
586     }
587 
588     private static RolePersistence _persistence;
589 }