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