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