1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="RoleUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class RoleUtil {
29      public static void cacheResult(com.liferay.portal.model.Role role) {
30          getPersistence().cacheResult(role);
31      }
32  
33      public static void cacheResult(
34          java.util.List<com.liferay.portal.model.Role> roles) {
35          getPersistence().cacheResult(roles);
36      }
37  
38      public static void clearCache() {
39          getPersistence().clearCache();
40      }
41  
42      public static com.liferay.portal.model.Role create(long roleId) {
43          return getPersistence().create(roleId);
44      }
45  
46      public static com.liferay.portal.model.Role remove(long roleId)
47          throws com.liferay.portal.NoSuchRoleException,
48              com.liferay.portal.SystemException {
49          return getPersistence().remove(roleId);
50      }
51  
52      public static com.liferay.portal.model.Role remove(
53          com.liferay.portal.model.Role role)
54          throws com.liferay.portal.SystemException {
55          return getPersistence().remove(role);
56      }
57  
58      /**
59       * @deprecated Use <code>update(Role role, boolean merge)</code>.
60       */
61      public static com.liferay.portal.model.Role update(
62          com.liferay.portal.model.Role role)
63          throws com.liferay.portal.SystemException {
64          return getPersistence().update(role);
65      }
66  
67      /**
68       * Add, update, or merge, the entity. This method also calls the model
69       * listeners to trigger the proper events associated with adding, deleting,
70       * or updating an entity.
71       *
72       * @param        role the entity to add, update, or merge
73       * @param        merge boolean value for whether to merge the entity. The
74       *                default value is false. Setting merge to true is more
75       *                expensive and should only be true when role is
76       *                transient. See LEP-5473 for a detailed discussion of this
77       *                method.
78       * @return        true if the portlet can be displayed via Ajax
79       */
80      public static com.liferay.portal.model.Role update(
81          com.liferay.portal.model.Role role, boolean merge)
82          throws com.liferay.portal.SystemException {
83          return getPersistence().update(role, merge);
84      }
85  
86      public static com.liferay.portal.model.Role updateImpl(
87          com.liferay.portal.model.Role role, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().updateImpl(role, merge);
90      }
91  
92      public static com.liferay.portal.model.Role findByPrimaryKey(long roleId)
93          throws com.liferay.portal.NoSuchRoleException,
94              com.liferay.portal.SystemException {
95          return getPersistence().findByPrimaryKey(roleId);
96      }
97  
98      public static com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
99          throws com.liferay.portal.SystemException {
100         return getPersistence().fetchByPrimaryKey(roleId);
101     }
102 
103     public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
104         long companyId) throws com.liferay.portal.SystemException {
105         return getPersistence().findByCompanyId(companyId);
106     }
107 
108     public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
109         long companyId, int start, int end)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByCompanyId(companyId, start, end);
112     }
113 
114     public static java.util.List<com.liferay.portal.model.Role> findByCompanyId(
115         long companyId, int start, int end,
116         com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().findByCompanyId(companyId, start, end, obc);
119     }
120 
121     public static com.liferay.portal.model.Role findByCompanyId_First(
122         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.NoSuchRoleException,
124             com.liferay.portal.SystemException {
125         return getPersistence().findByCompanyId_First(companyId, obc);
126     }
127 
128     public static com.liferay.portal.model.Role findByCompanyId_Last(
129         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.NoSuchRoleException,
131             com.liferay.portal.SystemException {
132         return getPersistence().findByCompanyId_Last(companyId, obc);
133     }
134 
135     public static com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
136         long roleId, long companyId,
137         com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.NoSuchRoleException,
139             com.liferay.portal.SystemException {
140         return getPersistence()
141                    .findByCompanyId_PrevAndNext(roleId, companyId, obc);
142     }
143 
144     public static com.liferay.portal.model.Role findByC_N(long companyId,
145         java.lang.String name)
146         throws com.liferay.portal.NoSuchRoleException,
147             com.liferay.portal.SystemException {
148         return getPersistence().findByC_N(companyId, name);
149     }
150 
151     public static com.liferay.portal.model.Role fetchByC_N(long companyId,
152         java.lang.String name) throws com.liferay.portal.SystemException {
153         return getPersistence().fetchByC_N(companyId, name);
154     }
155 
156     public static com.liferay.portal.model.Role fetchByC_N(long companyId,
157         java.lang.String name, boolean retrieveFromCache)
158         throws com.liferay.portal.SystemException {
159         return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
160     }
161 
162     public static java.util.List<com.liferay.portal.model.Role> findByT_S(
163         int type, java.lang.String subtype)
164         throws com.liferay.portal.SystemException {
165         return getPersistence().findByT_S(type, subtype);
166     }
167 
168     public static java.util.List<com.liferay.portal.model.Role> findByT_S(
169         int type, java.lang.String subtype, int start, int end)
170         throws com.liferay.portal.SystemException {
171         return getPersistence().findByT_S(type, subtype, start, end);
172     }
173 
174     public static java.util.List<com.liferay.portal.model.Role> findByT_S(
175         int type, java.lang.String subtype, int start, int end,
176         com.liferay.portal.kernel.util.OrderByComparator obc)
177         throws com.liferay.portal.SystemException {
178         return getPersistence().findByT_S(type, subtype, start, end, obc);
179     }
180 
181     public static com.liferay.portal.model.Role findByT_S_First(int type,
182         java.lang.String subtype,
183         com.liferay.portal.kernel.util.OrderByComparator obc)
184         throws com.liferay.portal.NoSuchRoleException,
185             com.liferay.portal.SystemException {
186         return getPersistence().findByT_S_First(type, subtype, obc);
187     }
188 
189     public static com.liferay.portal.model.Role findByT_S_Last(int type,
190         java.lang.String subtype,
191         com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.NoSuchRoleException,
193             com.liferay.portal.SystemException {
194         return getPersistence().findByT_S_Last(type, subtype, obc);
195     }
196 
197     public static com.liferay.portal.model.Role[] findByT_S_PrevAndNext(
198         long roleId, int type, java.lang.String subtype,
199         com.liferay.portal.kernel.util.OrderByComparator obc)
200         throws com.liferay.portal.NoSuchRoleException,
201             com.liferay.portal.SystemException {
202         return getPersistence().findByT_S_PrevAndNext(roleId, type, subtype, obc);
203     }
204 
205     public static com.liferay.portal.model.Role findByC_C_C(long companyId,
206         long classNameId, long classPK)
207         throws com.liferay.portal.NoSuchRoleException,
208             com.liferay.portal.SystemException {
209         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
210     }
211 
212     public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
213         long classNameId, long classPK)
214         throws com.liferay.portal.SystemException {
215         return getPersistence().fetchByC_C_C(companyId, classNameId, classPK);
216     }
217 
218     public static com.liferay.portal.model.Role fetchByC_C_C(long companyId,
219         long classNameId, long classPK, boolean retrieveFromCache)
220         throws com.liferay.portal.SystemException {
221         return getPersistence()
222                    .fetchByC_C_C(companyId, classNameId, classPK,
223             retrieveFromCache);
224     }
225 
226     public static java.util.List<Object> findWithDynamicQuery(
227         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
228         throws com.liferay.portal.SystemException {
229         return getPersistence().findWithDynamicQuery(dynamicQuery);
230     }
231 
232     public static java.util.List<Object> findWithDynamicQuery(
233         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
234         int end) throws com.liferay.portal.SystemException {
235         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
236     }
237 
238     public static java.util.List<com.liferay.portal.model.Role> findAll()
239         throws com.liferay.portal.SystemException {
240         return getPersistence().findAll();
241     }
242 
243     public static java.util.List<com.liferay.portal.model.Role> findAll(
244         int start, int end) throws com.liferay.portal.SystemException {
245         return getPersistence().findAll(start, end);
246     }
247 
248     public static java.util.List<com.liferay.portal.model.Role> findAll(
249         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
250         throws com.liferay.portal.SystemException {
251         return getPersistence().findAll(start, end, obc);
252     }
253 
254     public static void removeByCompanyId(long companyId)
255         throws com.liferay.portal.SystemException {
256         getPersistence().removeByCompanyId(companyId);
257     }
258 
259     public static void removeByC_N(long companyId, java.lang.String name)
260         throws com.liferay.portal.NoSuchRoleException,
261             com.liferay.portal.SystemException {
262         getPersistence().removeByC_N(companyId, name);
263     }
264 
265     public static void removeByT_S(int type, java.lang.String subtype)
266         throws com.liferay.portal.SystemException {
267         getPersistence().removeByT_S(type, subtype);
268     }
269 
270     public static void removeByC_C_C(long companyId, long classNameId,
271         long classPK)
272         throws com.liferay.portal.NoSuchRoleException,
273             com.liferay.portal.SystemException {
274         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
275     }
276 
277     public static void removeAll() throws com.liferay.portal.SystemException {
278         getPersistence().removeAll();
279     }
280 
281     public static int countByCompanyId(long companyId)
282         throws com.liferay.portal.SystemException {
283         return getPersistence().countByCompanyId(companyId);
284     }
285 
286     public static int countByC_N(long companyId, java.lang.String name)
287         throws com.liferay.portal.SystemException {
288         return getPersistence().countByC_N(companyId, name);
289     }
290 
291     public static int countByT_S(int type, java.lang.String subtype)
292         throws com.liferay.portal.SystemException {
293         return getPersistence().countByT_S(type, subtype);
294     }
295 
296     public static int countByC_C_C(long companyId, long classNameId,
297         long classPK) throws com.liferay.portal.SystemException {
298         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
299     }
300 
301     public static int countAll() throws com.liferay.portal.SystemException {
302         return getPersistence().countAll();
303     }
304 
305     public static java.util.List<com.liferay.portal.model.Group> getGroups(
306         long pk) throws com.liferay.portal.SystemException {
307         return getPersistence().getGroups(pk);
308     }
309 
310     public static java.util.List<com.liferay.portal.model.Group> getGroups(
311         long pk, int start, int end) throws com.liferay.portal.SystemException {
312         return getPersistence().getGroups(pk, start, end);
313     }
314 
315     public static java.util.List<com.liferay.portal.model.Group> getGroups(
316         long pk, int start, int end,
317         com.liferay.portal.kernel.util.OrderByComparator obc)
318         throws com.liferay.portal.SystemException {
319         return getPersistence().getGroups(pk, start, end, obc);
320     }
321 
322     public static int getGroupsSize(long pk)
323         throws com.liferay.portal.SystemException {
324         return getPersistence().getGroupsSize(pk);
325     }
326 
327     public static boolean containsGroup(long pk, long groupPK)
328         throws com.liferay.portal.SystemException {
329         return getPersistence().containsGroup(pk, groupPK);
330     }
331 
332     public static boolean containsGroups(long pk)
333         throws com.liferay.portal.SystemException {
334         return getPersistence().containsGroups(pk);
335     }
336 
337     public static void addGroup(long pk, long groupPK)
338         throws com.liferay.portal.SystemException {
339         getPersistence().addGroup(pk, groupPK);
340     }
341 
342     public static void addGroup(long pk, com.liferay.portal.model.Group group)
343         throws com.liferay.portal.SystemException {
344         getPersistence().addGroup(pk, group);
345     }
346 
347     public static void addGroups(long pk, long[] groupPKs)
348         throws com.liferay.portal.SystemException {
349         getPersistence().addGroups(pk, groupPKs);
350     }
351 
352     public static void addGroups(long pk,
353         java.util.List<com.liferay.portal.model.Group> groups)
354         throws com.liferay.portal.SystemException {
355         getPersistence().addGroups(pk, groups);
356     }
357 
358     public static void clearGroups(long pk)
359         throws com.liferay.portal.SystemException {
360         getPersistence().clearGroups(pk);
361     }
362 
363     public static void removeGroup(long pk, long groupPK)
364         throws com.liferay.portal.SystemException {
365         getPersistence().removeGroup(pk, groupPK);
366     }
367 
368     public static void removeGroup(long pk, com.liferay.portal.model.Group group)
369         throws com.liferay.portal.SystemException {
370         getPersistence().removeGroup(pk, group);
371     }
372 
373     public static void removeGroups(long pk, long[] groupPKs)
374         throws com.liferay.portal.SystemException {
375         getPersistence().removeGroups(pk, groupPKs);
376     }
377 
378     public static void removeGroups(long pk,
379         java.util.List<com.liferay.portal.model.Group> groups)
380         throws com.liferay.portal.SystemException {
381         getPersistence().removeGroups(pk, groups);
382     }
383 
384     public static void setGroups(long pk, long[] groupPKs)
385         throws com.liferay.portal.SystemException {
386         getPersistence().setGroups(pk, groupPKs);
387     }
388 
389     public static void setGroups(long pk,
390         java.util.List<com.liferay.portal.model.Group> groups)
391         throws com.liferay.portal.SystemException {
392         getPersistence().setGroups(pk, groups);
393     }
394 
395     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
396         long pk) throws com.liferay.portal.SystemException {
397         return getPersistence().getPermissions(pk);
398     }
399 
400     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
401         long pk, int start, int end) throws com.liferay.portal.SystemException {
402         return getPersistence().getPermissions(pk, start, end);
403     }
404 
405     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
406         long pk, int start, int end,
407         com.liferay.portal.kernel.util.OrderByComparator obc)
408         throws com.liferay.portal.SystemException {
409         return getPersistence().getPermissions(pk, start, end, obc);
410     }
411 
412     public static int getPermissionsSize(long pk)
413         throws com.liferay.portal.SystemException {
414         return getPersistence().getPermissionsSize(pk);
415     }
416 
417     public static boolean containsPermission(long pk, long permissionPK)
418         throws com.liferay.portal.SystemException {
419         return getPersistence().containsPermission(pk, permissionPK);
420     }
421 
422     public static boolean containsPermissions(long pk)
423         throws com.liferay.portal.SystemException {
424         return getPersistence().containsPermissions(pk);
425     }
426 
427     public static void addPermission(long pk, long permissionPK)
428         throws com.liferay.portal.SystemException {
429         getPersistence().addPermission(pk, permissionPK);
430     }
431 
432     public static void addPermission(long pk,
433         com.liferay.portal.model.Permission permission)
434         throws com.liferay.portal.SystemException {
435         getPersistence().addPermission(pk, permission);
436     }
437 
438     public static void addPermissions(long pk, long[] permissionPKs)
439         throws com.liferay.portal.SystemException {
440         getPersistence().addPermissions(pk, permissionPKs);
441     }
442 
443     public static void addPermissions(long pk,
444         java.util.List<com.liferay.portal.model.Permission> permissions)
445         throws com.liferay.portal.SystemException {
446         getPersistence().addPermissions(pk, permissions);
447     }
448 
449     public static void clearPermissions(long pk)
450         throws com.liferay.portal.SystemException {
451         getPersistence().clearPermissions(pk);
452     }
453 
454     public static void removePermission(long pk, long permissionPK)
455         throws com.liferay.portal.SystemException {
456         getPersistence().removePermission(pk, permissionPK);
457     }
458 
459     public static void removePermission(long pk,
460         com.liferay.portal.model.Permission permission)
461         throws com.liferay.portal.SystemException {
462         getPersistence().removePermission(pk, permission);
463     }
464 
465     public static void removePermissions(long pk, long[] permissionPKs)
466         throws com.liferay.portal.SystemException {
467         getPersistence().removePermissions(pk, permissionPKs);
468     }
469 
470     public static void removePermissions(long pk,
471         java.util.List<com.liferay.portal.model.Permission> permissions)
472         throws com.liferay.portal.SystemException {
473         getPersistence().removePermissions(pk, permissions);
474     }
475 
476     public static void setPermissions(long pk, long[] permissionPKs)
477         throws com.liferay.portal.SystemException {
478         getPersistence().setPermissions(pk, permissionPKs);
479     }
480 
481     public static void setPermissions(long pk,
482         java.util.List<com.liferay.portal.model.Permission> permissions)
483         throws com.liferay.portal.SystemException {
484         getPersistence().setPermissions(pk, permissions);
485     }
486 
487     public static java.util.List<com.liferay.portal.model.User> getUsers(
488         long pk) throws com.liferay.portal.SystemException {
489         return getPersistence().getUsers(pk);
490     }
491 
492     public static java.util.List<com.liferay.portal.model.User> getUsers(
493         long pk, int start, int end) throws com.liferay.portal.SystemException {
494         return getPersistence().getUsers(pk, start, end);
495     }
496 
497     public static java.util.List<com.liferay.portal.model.User> getUsers(
498         long pk, int start, int end,
499         com.liferay.portal.kernel.util.OrderByComparator obc)
500         throws com.liferay.portal.SystemException {
501         return getPersistence().getUsers(pk, start, end, obc);
502     }
503 
504     public static int getUsersSize(long pk)
505         throws com.liferay.portal.SystemException {
506         return getPersistence().getUsersSize(pk);
507     }
508 
509     public static boolean containsUser(long pk, long userPK)
510         throws com.liferay.portal.SystemException {
511         return getPersistence().containsUser(pk, userPK);
512     }
513 
514     public static boolean containsUsers(long pk)
515         throws com.liferay.portal.SystemException {
516         return getPersistence().containsUsers(pk);
517     }
518 
519     public static void addUser(long pk, long userPK)
520         throws com.liferay.portal.SystemException {
521         getPersistence().addUser(pk, userPK);
522     }
523 
524     public static void addUser(long pk, com.liferay.portal.model.User user)
525         throws com.liferay.portal.SystemException {
526         getPersistence().addUser(pk, user);
527     }
528 
529     public static void addUsers(long pk, long[] userPKs)
530         throws com.liferay.portal.SystemException {
531         getPersistence().addUsers(pk, userPKs);
532     }
533 
534     public static void addUsers(long pk,
535         java.util.List<com.liferay.portal.model.User> users)
536         throws com.liferay.portal.SystemException {
537         getPersistence().addUsers(pk, users);
538     }
539 
540     public static void clearUsers(long pk)
541         throws com.liferay.portal.SystemException {
542         getPersistence().clearUsers(pk);
543     }
544 
545     public static void removeUser(long pk, long userPK)
546         throws com.liferay.portal.SystemException {
547         getPersistence().removeUser(pk, userPK);
548     }
549 
550     public static void removeUser(long pk, com.liferay.portal.model.User user)
551         throws com.liferay.portal.SystemException {
552         getPersistence().removeUser(pk, user);
553     }
554 
555     public static void removeUsers(long pk, long[] userPKs)
556         throws com.liferay.portal.SystemException {
557         getPersistence().removeUsers(pk, userPKs);
558     }
559 
560     public static void removeUsers(long pk,
561         java.util.List<com.liferay.portal.model.User> users)
562         throws com.liferay.portal.SystemException {
563         getPersistence().removeUsers(pk, users);
564     }
565 
566     public static void setUsers(long pk, long[] userPKs)
567         throws com.liferay.portal.SystemException {
568         getPersistence().setUsers(pk, userPKs);
569     }
570 
571     public static void setUsers(long pk,
572         java.util.List<com.liferay.portal.model.User> users)
573         throws com.liferay.portal.SystemException {
574         getPersistence().setUsers(pk, users);
575     }
576 
577     public static RolePersistence getPersistence() {
578         return _persistence;
579     }
580 
581     public void setPersistence(RolePersistence persistence) {
582         _persistence = persistence;
583     }
584 
585     private static RolePersistence _persistence;
586 }