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