001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.persistence;
022:
023: /**
024: * <a href="RoleUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * @author Brian Wing Shun Chan
027: *
028: */
029: public class RoleUtil {
030: public static com.liferay.portal.model.Role create(long roleId) {
031: return getPersistence().create(roleId);
032: }
033:
034: public static com.liferay.portal.model.Role remove(long roleId)
035: throws com.liferay.portal.SystemException,
036: com.liferay.portal.NoSuchRoleException {
037: return getPersistence().remove(roleId);
038: }
039:
040: public static com.liferay.portal.model.Role remove(
041: com.liferay.portal.model.Role role)
042: throws com.liferay.portal.SystemException {
043: return getPersistence().remove(role);
044: }
045:
046: public static com.liferay.portal.model.Role update(
047: com.liferay.portal.model.Role role)
048: throws com.liferay.portal.SystemException {
049: return getPersistence().update(role);
050: }
051:
052: public static com.liferay.portal.model.Role update(
053: com.liferay.portal.model.Role role, boolean merge)
054: throws com.liferay.portal.SystemException {
055: return getPersistence().update(role, merge);
056: }
057:
058: public static com.liferay.portal.model.Role updateImpl(
059: com.liferay.portal.model.Role role, boolean merge)
060: throws com.liferay.portal.SystemException {
061: return getPersistence().updateImpl(role, merge);
062: }
063:
064: public static com.liferay.portal.model.Role findByPrimaryKey(
065: long roleId) throws com.liferay.portal.SystemException,
066: com.liferay.portal.NoSuchRoleException {
067: return getPersistence().findByPrimaryKey(roleId);
068: }
069:
070: public static com.liferay.portal.model.Role fetchByPrimaryKey(
071: long roleId) throws com.liferay.portal.SystemException {
072: return getPersistence().fetchByPrimaryKey(roleId);
073: }
074:
075: public static java.util.List findByCompanyId(long companyId)
076: throws com.liferay.portal.SystemException {
077: return getPersistence().findByCompanyId(companyId);
078: }
079:
080: public static java.util.List findByCompanyId(long companyId,
081: int begin, int end)
082: throws com.liferay.portal.SystemException {
083: return getPersistence().findByCompanyId(companyId, begin, end);
084: }
085:
086: public static java.util.List findByCompanyId(long companyId,
087: int begin, int end,
088: com.liferay.portal.kernel.util.OrderByComparator obc)
089: throws com.liferay.portal.SystemException {
090: return getPersistence().findByCompanyId(companyId, begin, end,
091: obc);
092: }
093:
094: public static com.liferay.portal.model.Role findByCompanyId_First(
095: long companyId,
096: com.liferay.portal.kernel.util.OrderByComparator obc)
097: throws com.liferay.portal.SystemException,
098: com.liferay.portal.NoSuchRoleException {
099: return getPersistence().findByCompanyId_First(companyId, obc);
100: }
101:
102: public static com.liferay.portal.model.Role findByCompanyId_Last(
103: long companyId,
104: com.liferay.portal.kernel.util.OrderByComparator obc)
105: throws com.liferay.portal.SystemException,
106: com.liferay.portal.NoSuchRoleException {
107: return getPersistence().findByCompanyId_Last(companyId, obc);
108: }
109:
110: public static com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
111: long roleId, long companyId,
112: com.liferay.portal.kernel.util.OrderByComparator obc)
113: throws com.liferay.portal.SystemException,
114: com.liferay.portal.NoSuchRoleException {
115: return getPersistence().findByCompanyId_PrevAndNext(roleId,
116: companyId, obc);
117: }
118:
119: public static com.liferay.portal.model.Role findByC_N(
120: long companyId, java.lang.String name)
121: throws com.liferay.portal.SystemException,
122: com.liferay.portal.NoSuchRoleException {
123: return getPersistence().findByC_N(companyId, name);
124: }
125:
126: public static com.liferay.portal.model.Role fetchByC_N(
127: long companyId, java.lang.String name)
128: throws com.liferay.portal.SystemException {
129: return getPersistence().fetchByC_N(companyId, name);
130: }
131:
132: public static com.liferay.portal.model.Role findByC_C_C(
133: long companyId, long classNameId, long classPK)
134: throws com.liferay.portal.SystemException,
135: com.liferay.portal.NoSuchRoleException {
136: return getPersistence().findByC_C_C(companyId, classNameId,
137: classPK);
138: }
139:
140: public static com.liferay.portal.model.Role fetchByC_C_C(
141: long companyId, long classNameId, long classPK)
142: throws com.liferay.portal.SystemException {
143: return getPersistence().fetchByC_C_C(companyId, classNameId,
144: classPK);
145: }
146:
147: public static java.util.List findWithDynamicQuery(
148: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
149: throws com.liferay.portal.SystemException {
150: return getPersistence().findWithDynamicQuery(queryInitializer);
151: }
152:
153: public static java.util.List findWithDynamicQuery(
154: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
155: int begin, int end)
156: throws com.liferay.portal.SystemException {
157: return getPersistence().findWithDynamicQuery(queryInitializer,
158: begin, end);
159: }
160:
161: public static java.util.List findAll()
162: throws com.liferay.portal.SystemException {
163: return getPersistence().findAll();
164: }
165:
166: public static java.util.List findAll(int begin, int end)
167: throws com.liferay.portal.SystemException {
168: return getPersistence().findAll(begin, end);
169: }
170:
171: public static java.util.List findAll(int begin, int end,
172: com.liferay.portal.kernel.util.OrderByComparator obc)
173: throws com.liferay.portal.SystemException {
174: return getPersistence().findAll(begin, end, obc);
175: }
176:
177: public static void removeByCompanyId(long companyId)
178: throws com.liferay.portal.SystemException {
179: getPersistence().removeByCompanyId(companyId);
180: }
181:
182: public static void removeByC_N(long companyId, java.lang.String name)
183: throws com.liferay.portal.SystemException,
184: com.liferay.portal.NoSuchRoleException {
185: getPersistence().removeByC_N(companyId, name);
186: }
187:
188: public static void removeByC_C_C(long companyId, long classNameId,
189: long classPK) throws com.liferay.portal.SystemException,
190: com.liferay.portal.NoSuchRoleException {
191: getPersistence().removeByC_C_C(companyId, classNameId, classPK);
192: }
193:
194: public static void removeAll()
195: throws com.liferay.portal.SystemException {
196: getPersistence().removeAll();
197: }
198:
199: public static int countByCompanyId(long companyId)
200: throws com.liferay.portal.SystemException {
201: return getPersistence().countByCompanyId(companyId);
202: }
203:
204: public static int countByC_N(long companyId, java.lang.String name)
205: throws com.liferay.portal.SystemException {
206: return getPersistence().countByC_N(companyId, name);
207: }
208:
209: public static int countByC_C_C(long companyId, long classNameId,
210: long classPK) throws com.liferay.portal.SystemException {
211: return getPersistence().countByC_C_C(companyId, classNameId,
212: classPK);
213: }
214:
215: public static int countAll()
216: throws com.liferay.portal.SystemException {
217: return getPersistence().countAll();
218: }
219:
220: public static java.util.List getGroups(long pk)
221: throws com.liferay.portal.SystemException,
222: com.liferay.portal.NoSuchRoleException {
223: return getPersistence().getGroups(pk);
224: }
225:
226: public static java.util.List getGroups(long pk, int begin, int end)
227: throws com.liferay.portal.SystemException,
228: com.liferay.portal.NoSuchRoleException {
229: return getPersistence().getGroups(pk, begin, end);
230: }
231:
232: public static java.util.List getGroups(long pk, int begin, int end,
233: com.liferay.portal.kernel.util.OrderByComparator obc)
234: throws com.liferay.portal.SystemException,
235: com.liferay.portal.NoSuchRoleException {
236: return getPersistence().getGroups(pk, begin, end, obc);
237: }
238:
239: public static int getGroupsSize(long pk)
240: throws com.liferay.portal.SystemException {
241: return getPersistence().getGroupsSize(pk);
242: }
243:
244: public static boolean containsGroup(long pk, long groupPK)
245: throws com.liferay.portal.SystemException {
246: return getPersistence().containsGroup(pk, groupPK);
247: }
248:
249: public static boolean containsGroups(long pk)
250: throws com.liferay.portal.SystemException {
251: return getPersistence().containsGroups(pk);
252: }
253:
254: public static void addGroup(long pk, long groupPK)
255: throws com.liferay.portal.SystemException,
256: com.liferay.portal.NoSuchGroupException,
257: com.liferay.portal.NoSuchRoleException {
258: getPersistence().addGroup(pk, groupPK);
259: }
260:
261: public static void addGroup(long pk,
262: com.liferay.portal.model.Group group)
263: throws com.liferay.portal.SystemException,
264: com.liferay.portal.NoSuchGroupException,
265: com.liferay.portal.NoSuchRoleException {
266: getPersistence().addGroup(pk, group);
267: }
268:
269: public static void addGroups(long pk, long[] groupPKs)
270: throws com.liferay.portal.SystemException,
271: com.liferay.portal.NoSuchGroupException,
272: com.liferay.portal.NoSuchRoleException {
273: getPersistence().addGroups(pk, groupPKs);
274: }
275:
276: public static void addGroups(long pk, java.util.List groups)
277: throws com.liferay.portal.SystemException,
278: com.liferay.portal.NoSuchGroupException,
279: com.liferay.portal.NoSuchRoleException {
280: getPersistence().addGroups(pk, groups);
281: }
282:
283: public static void clearGroups(long pk)
284: throws com.liferay.portal.SystemException,
285: com.liferay.portal.NoSuchRoleException {
286: getPersistence().clearGroups(pk);
287: }
288:
289: public static void removeGroup(long pk, long groupPK)
290: throws com.liferay.portal.SystemException,
291: com.liferay.portal.NoSuchGroupException,
292: com.liferay.portal.NoSuchRoleException {
293: getPersistence().removeGroup(pk, groupPK);
294: }
295:
296: public static void removeGroup(long pk,
297: com.liferay.portal.model.Group group)
298: throws com.liferay.portal.SystemException,
299: com.liferay.portal.NoSuchGroupException,
300: com.liferay.portal.NoSuchRoleException {
301: getPersistence().removeGroup(pk, group);
302: }
303:
304: public static void removeGroups(long pk, long[] groupPKs)
305: throws com.liferay.portal.SystemException,
306: com.liferay.portal.NoSuchGroupException,
307: com.liferay.portal.NoSuchRoleException {
308: getPersistence().removeGroups(pk, groupPKs);
309: }
310:
311: public static void removeGroups(long pk, java.util.List groups)
312: throws com.liferay.portal.SystemException,
313: com.liferay.portal.NoSuchGroupException,
314: com.liferay.portal.NoSuchRoleException {
315: getPersistence().removeGroups(pk, groups);
316: }
317:
318: public static void setGroups(long pk, long[] groupPKs)
319: throws com.liferay.portal.SystemException,
320: com.liferay.portal.NoSuchGroupException,
321: com.liferay.portal.NoSuchRoleException {
322: getPersistence().setGroups(pk, groupPKs);
323: }
324:
325: public static void setGroups(long pk, java.util.List groups)
326: throws com.liferay.portal.SystemException,
327: com.liferay.portal.NoSuchGroupException,
328: com.liferay.portal.NoSuchRoleException {
329: getPersistence().setGroups(pk, groups);
330: }
331:
332: public static java.util.List getPermissions(long pk)
333: throws com.liferay.portal.SystemException,
334: com.liferay.portal.NoSuchRoleException {
335: return getPersistence().getPermissions(pk);
336: }
337:
338: public static java.util.List getPermissions(long pk, int begin,
339: int end) throws com.liferay.portal.SystemException,
340: com.liferay.portal.NoSuchRoleException {
341: return getPersistence().getPermissions(pk, begin, end);
342: }
343:
344: public static java.util.List getPermissions(long pk, int begin,
345: int end,
346: com.liferay.portal.kernel.util.OrderByComparator obc)
347: throws com.liferay.portal.SystemException,
348: com.liferay.portal.NoSuchRoleException {
349: return getPersistence().getPermissions(pk, begin, end, obc);
350: }
351:
352: public static int getPermissionsSize(long pk)
353: throws com.liferay.portal.SystemException {
354: return getPersistence().getPermissionsSize(pk);
355: }
356:
357: public static boolean containsPermission(long pk, long permissionPK)
358: throws com.liferay.portal.SystemException {
359: return getPersistence().containsPermission(pk, permissionPK);
360: }
361:
362: public static boolean containsPermissions(long pk)
363: throws com.liferay.portal.SystemException {
364: return getPersistence().containsPermissions(pk);
365: }
366:
367: public static void addPermission(long pk, long permissionPK)
368: throws com.liferay.portal.SystemException,
369: com.liferay.portal.NoSuchPermissionException,
370: com.liferay.portal.NoSuchRoleException {
371: getPersistence().addPermission(pk, permissionPK);
372: }
373:
374: public static void addPermission(long pk,
375: com.liferay.portal.model.Permission permission)
376: throws com.liferay.portal.SystemException,
377: com.liferay.portal.NoSuchPermissionException,
378: com.liferay.portal.NoSuchRoleException {
379: getPersistence().addPermission(pk, permission);
380: }
381:
382: public static void addPermissions(long pk, long[] permissionPKs)
383: throws com.liferay.portal.SystemException,
384: com.liferay.portal.NoSuchPermissionException,
385: com.liferay.portal.NoSuchRoleException {
386: getPersistence().addPermissions(pk, permissionPKs);
387: }
388:
389: public static void addPermissions(long pk,
390: java.util.List permissions)
391: throws com.liferay.portal.SystemException,
392: com.liferay.portal.NoSuchPermissionException,
393: com.liferay.portal.NoSuchRoleException {
394: getPersistence().addPermissions(pk, permissions);
395: }
396:
397: public static void clearPermissions(long pk)
398: throws com.liferay.portal.SystemException,
399: com.liferay.portal.NoSuchRoleException {
400: getPersistence().clearPermissions(pk);
401: }
402:
403: public static void removePermission(long pk, long permissionPK)
404: throws com.liferay.portal.SystemException,
405: com.liferay.portal.NoSuchPermissionException,
406: com.liferay.portal.NoSuchRoleException {
407: getPersistence().removePermission(pk, permissionPK);
408: }
409:
410: public static void removePermission(long pk,
411: com.liferay.portal.model.Permission permission)
412: throws com.liferay.portal.SystemException,
413: com.liferay.portal.NoSuchPermissionException,
414: com.liferay.portal.NoSuchRoleException {
415: getPersistence().removePermission(pk, permission);
416: }
417:
418: public static void removePermissions(long pk, long[] permissionPKs)
419: throws com.liferay.portal.SystemException,
420: com.liferay.portal.NoSuchPermissionException,
421: com.liferay.portal.NoSuchRoleException {
422: getPersistence().removePermissions(pk, permissionPKs);
423: }
424:
425: public static void removePermissions(long pk,
426: java.util.List permissions)
427: throws com.liferay.portal.SystemException,
428: com.liferay.portal.NoSuchPermissionException,
429: com.liferay.portal.NoSuchRoleException {
430: getPersistence().removePermissions(pk, permissions);
431: }
432:
433: public static void setPermissions(long pk, long[] permissionPKs)
434: throws com.liferay.portal.SystemException,
435: com.liferay.portal.NoSuchPermissionException,
436: com.liferay.portal.NoSuchRoleException {
437: getPersistence().setPermissions(pk, permissionPKs);
438: }
439:
440: public static void setPermissions(long pk,
441: java.util.List permissions)
442: throws com.liferay.portal.SystemException,
443: com.liferay.portal.NoSuchPermissionException,
444: com.liferay.portal.NoSuchRoleException {
445: getPersistence().setPermissions(pk, permissions);
446: }
447:
448: public static java.util.List getUsers(long pk)
449: throws com.liferay.portal.SystemException,
450: com.liferay.portal.NoSuchRoleException {
451: return getPersistence().getUsers(pk);
452: }
453:
454: public static java.util.List getUsers(long pk, int begin, int end)
455: throws com.liferay.portal.SystemException,
456: com.liferay.portal.NoSuchRoleException {
457: return getPersistence().getUsers(pk, begin, end);
458: }
459:
460: public static java.util.List getUsers(long pk, int begin, int end,
461: com.liferay.portal.kernel.util.OrderByComparator obc)
462: throws com.liferay.portal.SystemException,
463: com.liferay.portal.NoSuchRoleException {
464: return getPersistence().getUsers(pk, begin, end, obc);
465: }
466:
467: public static int getUsersSize(long pk)
468: throws com.liferay.portal.SystemException {
469: return getPersistence().getUsersSize(pk);
470: }
471:
472: public static boolean containsUser(long pk, long userPK)
473: throws com.liferay.portal.SystemException {
474: return getPersistence().containsUser(pk, userPK);
475: }
476:
477: public static boolean containsUsers(long pk)
478: throws com.liferay.portal.SystemException {
479: return getPersistence().containsUsers(pk);
480: }
481:
482: public static void addUser(long pk, long userPK)
483: throws com.liferay.portal.SystemException,
484: com.liferay.portal.NoSuchRoleException,
485: com.liferay.portal.NoSuchUserException {
486: getPersistence().addUser(pk, userPK);
487: }
488:
489: public static void addUser(long pk,
490: com.liferay.portal.model.User user)
491: throws com.liferay.portal.SystemException,
492: com.liferay.portal.NoSuchRoleException,
493: com.liferay.portal.NoSuchUserException {
494: getPersistence().addUser(pk, user);
495: }
496:
497: public static void addUsers(long pk, long[] userPKs)
498: throws com.liferay.portal.SystemException,
499: com.liferay.portal.NoSuchRoleException,
500: com.liferay.portal.NoSuchUserException {
501: getPersistence().addUsers(pk, userPKs);
502: }
503:
504: public static void addUsers(long pk, java.util.List users)
505: throws com.liferay.portal.SystemException,
506: com.liferay.portal.NoSuchRoleException,
507: com.liferay.portal.NoSuchUserException {
508: getPersistence().addUsers(pk, users);
509: }
510:
511: public static void clearUsers(long pk)
512: throws com.liferay.portal.SystemException,
513: com.liferay.portal.NoSuchRoleException {
514: getPersistence().clearUsers(pk);
515: }
516:
517: public static void removeUser(long pk, long userPK)
518: throws com.liferay.portal.SystemException,
519: com.liferay.portal.NoSuchRoleException,
520: com.liferay.portal.NoSuchUserException {
521: getPersistence().removeUser(pk, userPK);
522: }
523:
524: public static void removeUser(long pk,
525: com.liferay.portal.model.User user)
526: throws com.liferay.portal.SystemException,
527: com.liferay.portal.NoSuchRoleException,
528: com.liferay.portal.NoSuchUserException {
529: getPersistence().removeUser(pk, user);
530: }
531:
532: public static void removeUsers(long pk, long[] userPKs)
533: throws com.liferay.portal.SystemException,
534: com.liferay.portal.NoSuchRoleException,
535: com.liferay.portal.NoSuchUserException {
536: getPersistence().removeUsers(pk, userPKs);
537: }
538:
539: public static void removeUsers(long pk, java.util.List users)
540: throws com.liferay.portal.SystemException,
541: com.liferay.portal.NoSuchRoleException,
542: com.liferay.portal.NoSuchUserException {
543: getPersistence().removeUsers(pk, users);
544: }
545:
546: public static void setUsers(long pk, long[] userPKs)
547: throws com.liferay.portal.SystemException,
548: com.liferay.portal.NoSuchRoleException,
549: com.liferay.portal.NoSuchUserException {
550: getPersistence().setUsers(pk, userPKs);
551: }
552:
553: public static void setUsers(long pk, java.util.List users)
554: throws com.liferay.portal.SystemException,
555: com.liferay.portal.NoSuchRoleException,
556: com.liferay.portal.NoSuchUserException {
557: getPersistence().setUsers(pk, users);
558: }
559:
560: public static RolePersistence getPersistence() {
561: return _getUtil()._persistence;
562: }
563:
564: public void setPersistence(RolePersistence persistence) {
565: _persistence = persistence;
566: }
567:
568: private static RoleUtil _getUtil() {
569: if (_util == null) {
570: _util = (RoleUtil) com.liferay.portal.kernel.bean.BeanLocatorUtil
571: .locate(_UTIL);
572: }
573:
574: return _util;
575: }
576:
577: private static final String _UTIL = RoleUtil.class.getName();
578: private static RoleUtil _util;
579: private RolePersistence _persistence;
580: }
|