1   /**
2    * Copyright (c) 2000-2007 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="RolePersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface RolePersistence {
32      public com.liferay.portal.model.Role create(long roleId);
33  
34      public com.liferay.portal.model.Role remove(long roleId)
35          throws com.liferay.portal.SystemException, 
36              com.liferay.portal.NoSuchRoleException;
37  
38      public com.liferay.portal.model.Role remove(
39          com.liferay.portal.model.Role role)
40          throws com.liferay.portal.SystemException;
41  
42      public com.liferay.portal.model.Role update(
43          com.liferay.portal.model.Role role)
44          throws com.liferay.portal.SystemException;
45  
46      public com.liferay.portal.model.Role update(
47          com.liferay.portal.model.Role role, boolean merge)
48          throws com.liferay.portal.SystemException;
49  
50      public com.liferay.portal.model.Role findByPrimaryKey(long roleId)
51          throws com.liferay.portal.SystemException, 
52              com.liferay.portal.NoSuchRoleException;
53  
54      public com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
55          throws com.liferay.portal.SystemException;
56  
57      public java.util.List findByCompanyId(long companyId)
58          throws com.liferay.portal.SystemException;
59  
60      public java.util.List findByCompanyId(long companyId, int begin, int end)
61          throws com.liferay.portal.SystemException;
62  
63      public java.util.List findByCompanyId(long companyId, int begin, int end,
64          com.liferay.portal.kernel.util.OrderByComparator obc)
65          throws com.liferay.portal.SystemException;
66  
67      public com.liferay.portal.model.Role findByCompanyId_First(long companyId,
68          com.liferay.portal.kernel.util.OrderByComparator obc)
69          throws com.liferay.portal.SystemException, 
70              com.liferay.portal.NoSuchRoleException;
71  
72      public com.liferay.portal.model.Role findByCompanyId_Last(long companyId,
73          com.liferay.portal.kernel.util.OrderByComparator obc)
74          throws com.liferay.portal.SystemException, 
75              com.liferay.portal.NoSuchRoleException;
76  
77      public com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
78          long roleId, long companyId,
79          com.liferay.portal.kernel.util.OrderByComparator obc)
80          throws com.liferay.portal.SystemException, 
81              com.liferay.portal.NoSuchRoleException;
82  
83      public com.liferay.portal.model.Role findByC_N(long companyId,
84          java.lang.String name)
85          throws com.liferay.portal.SystemException, 
86              com.liferay.portal.NoSuchRoleException;
87  
88      public com.liferay.portal.model.Role fetchByC_N(long companyId,
89          java.lang.String name) throws com.liferay.portal.SystemException;
90  
91      public com.liferay.portal.model.Role findByC_C_C(long companyId,
92          long classNameId, long classPK)
93          throws com.liferay.portal.SystemException, 
94              com.liferay.portal.NoSuchRoleException;
95  
96      public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
97          long classNameId, long classPK)
98          throws com.liferay.portal.SystemException;
99  
100     public java.util.List findWithDynamicQuery(
101         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
102         throws com.liferay.portal.SystemException;
103 
104     public java.util.List findWithDynamicQuery(
105         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
106         int begin, int end) throws com.liferay.portal.SystemException;
107 
108     public java.util.List findAll() throws com.liferay.portal.SystemException;
109 
110     public java.util.List findAll(int begin, int end)
111         throws com.liferay.portal.SystemException;
112 
113     public java.util.List findAll(int begin, int end,
114         com.liferay.portal.kernel.util.OrderByComparator obc)
115         throws com.liferay.portal.SystemException;
116 
117     public void removeByCompanyId(long companyId)
118         throws com.liferay.portal.SystemException;
119 
120     public void removeByC_N(long companyId, java.lang.String name)
121         throws com.liferay.portal.SystemException, 
122             com.liferay.portal.NoSuchRoleException;
123 
124     public void removeByC_C_C(long companyId, long classNameId, long classPK)
125         throws com.liferay.portal.SystemException, 
126             com.liferay.portal.NoSuchRoleException;
127 
128     public void removeAll() throws com.liferay.portal.SystemException;
129 
130     public int countByCompanyId(long companyId)
131         throws com.liferay.portal.SystemException;
132 
133     public int countByC_N(long companyId, java.lang.String name)
134         throws com.liferay.portal.SystemException;
135 
136     public int countByC_C_C(long companyId, long classNameId, long classPK)
137         throws com.liferay.portal.SystemException;
138 
139     public int countAll() throws com.liferay.portal.SystemException;
140 
141     public java.util.List getGroups(long pk)
142         throws com.liferay.portal.SystemException, 
143             com.liferay.portal.NoSuchRoleException;
144 
145     public java.util.List getGroups(long pk, int begin, int end)
146         throws com.liferay.portal.SystemException, 
147             com.liferay.portal.NoSuchRoleException;
148 
149     public java.util.List getGroups(long pk, int begin, int end,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.SystemException, 
152             com.liferay.portal.NoSuchRoleException;
153 
154     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
155 
156     public boolean containsGroup(long pk, long groupPK)
157         throws com.liferay.portal.SystemException;
158 
159     public boolean containsGroups(long pk)
160         throws com.liferay.portal.SystemException;
161 
162     public void addGroup(long pk, long groupPK)
163         throws com.liferay.portal.SystemException, 
164             com.liferay.portal.NoSuchGroupException, 
165             com.liferay.portal.NoSuchRoleException;
166 
167     public void addGroup(long pk, com.liferay.portal.model.Group group)
168         throws com.liferay.portal.SystemException, 
169             com.liferay.portal.NoSuchGroupException, 
170             com.liferay.portal.NoSuchRoleException;
171 
172     public void addGroups(long pk, long[] groupPKs)
173         throws com.liferay.portal.SystemException, 
174             com.liferay.portal.NoSuchGroupException, 
175             com.liferay.portal.NoSuchRoleException;
176 
177     public void addGroups(long pk, java.util.List groups)
178         throws com.liferay.portal.SystemException, 
179             com.liferay.portal.NoSuchGroupException, 
180             com.liferay.portal.NoSuchRoleException;
181 
182     public void clearGroups(long pk)
183         throws com.liferay.portal.SystemException, 
184             com.liferay.portal.NoSuchRoleException;
185 
186     public void removeGroup(long pk, long groupPK)
187         throws com.liferay.portal.SystemException, 
188             com.liferay.portal.NoSuchGroupException, 
189             com.liferay.portal.NoSuchRoleException;
190 
191     public void removeGroup(long pk, com.liferay.portal.model.Group group)
192         throws com.liferay.portal.SystemException, 
193             com.liferay.portal.NoSuchGroupException, 
194             com.liferay.portal.NoSuchRoleException;
195 
196     public void removeGroups(long pk, long[] groupPKs)
197         throws com.liferay.portal.SystemException, 
198             com.liferay.portal.NoSuchGroupException, 
199             com.liferay.portal.NoSuchRoleException;
200 
201     public void removeGroups(long pk, java.util.List groups)
202         throws com.liferay.portal.SystemException, 
203             com.liferay.portal.NoSuchGroupException, 
204             com.liferay.portal.NoSuchRoleException;
205 
206     public void setGroups(long pk, long[] groupPKs)
207         throws com.liferay.portal.SystemException, 
208             com.liferay.portal.NoSuchGroupException, 
209             com.liferay.portal.NoSuchRoleException;
210 
211     public void setGroups(long pk, java.util.List groups)
212         throws com.liferay.portal.SystemException, 
213             com.liferay.portal.NoSuchGroupException, 
214             com.liferay.portal.NoSuchRoleException;
215 
216     public java.util.List getPermissions(long pk)
217         throws com.liferay.portal.SystemException, 
218             com.liferay.portal.NoSuchRoleException;
219 
220     public java.util.List getPermissions(long pk, int begin, int end)
221         throws com.liferay.portal.SystemException, 
222             com.liferay.portal.NoSuchRoleException;
223 
224     public java.util.List getPermissions(long pk, int begin, int end,
225         com.liferay.portal.kernel.util.OrderByComparator obc)
226         throws com.liferay.portal.SystemException, 
227             com.liferay.portal.NoSuchRoleException;
228 
229     public int getPermissionsSize(long pk)
230         throws com.liferay.portal.SystemException;
231 
232     public boolean containsPermission(long pk, long permissionPK)
233         throws com.liferay.portal.SystemException;
234 
235     public boolean containsPermissions(long pk)
236         throws com.liferay.portal.SystemException;
237 
238     public void addPermission(long pk, long permissionPK)
239         throws com.liferay.portal.SystemException, 
240             com.liferay.portal.NoSuchPermissionException, 
241             com.liferay.portal.NoSuchRoleException;
242 
243     public void addPermission(long pk,
244         com.liferay.portal.model.Permission permission)
245         throws com.liferay.portal.SystemException, 
246             com.liferay.portal.NoSuchPermissionException, 
247             com.liferay.portal.NoSuchRoleException;
248 
249     public void addPermissions(long pk, long[] permissionPKs)
250         throws com.liferay.portal.SystemException, 
251             com.liferay.portal.NoSuchPermissionException, 
252             com.liferay.portal.NoSuchRoleException;
253 
254     public void addPermissions(long pk, java.util.List permissions)
255         throws com.liferay.portal.SystemException, 
256             com.liferay.portal.NoSuchPermissionException, 
257             com.liferay.portal.NoSuchRoleException;
258 
259     public void clearPermissions(long pk)
260         throws com.liferay.portal.SystemException, 
261             com.liferay.portal.NoSuchRoleException;
262 
263     public void removePermission(long pk, long permissionPK)
264         throws com.liferay.portal.SystemException, 
265             com.liferay.portal.NoSuchPermissionException, 
266             com.liferay.portal.NoSuchRoleException;
267 
268     public void removePermission(long pk,
269         com.liferay.portal.model.Permission permission)
270         throws com.liferay.portal.SystemException, 
271             com.liferay.portal.NoSuchPermissionException, 
272             com.liferay.portal.NoSuchRoleException;
273 
274     public void removePermissions(long pk, long[] permissionPKs)
275         throws com.liferay.portal.SystemException, 
276             com.liferay.portal.NoSuchPermissionException, 
277             com.liferay.portal.NoSuchRoleException;
278 
279     public void removePermissions(long pk, java.util.List permissions)
280         throws com.liferay.portal.SystemException, 
281             com.liferay.portal.NoSuchPermissionException, 
282             com.liferay.portal.NoSuchRoleException;
283 
284     public void setPermissions(long pk, long[] permissionPKs)
285         throws com.liferay.portal.SystemException, 
286             com.liferay.portal.NoSuchPermissionException, 
287             com.liferay.portal.NoSuchRoleException;
288 
289     public void setPermissions(long pk, java.util.List permissions)
290         throws com.liferay.portal.SystemException, 
291             com.liferay.portal.NoSuchPermissionException, 
292             com.liferay.portal.NoSuchRoleException;
293 
294     public java.util.List getUsers(long pk)
295         throws com.liferay.portal.SystemException, 
296             com.liferay.portal.NoSuchRoleException;
297 
298     public java.util.List getUsers(long pk, int begin, int end)
299         throws com.liferay.portal.SystemException, 
300             com.liferay.portal.NoSuchRoleException;
301 
302     public java.util.List getUsers(long pk, int begin, int end,
303         com.liferay.portal.kernel.util.OrderByComparator obc)
304         throws com.liferay.portal.SystemException, 
305             com.liferay.portal.NoSuchRoleException;
306 
307     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
308 
309     public boolean containsUser(long pk, long userPK)
310         throws com.liferay.portal.SystemException;
311 
312     public boolean containsUsers(long pk)
313         throws com.liferay.portal.SystemException;
314 
315     public void addUser(long pk, long userPK)
316         throws com.liferay.portal.SystemException, 
317             com.liferay.portal.NoSuchRoleException, 
318             com.liferay.portal.NoSuchUserException;
319 
320     public void addUser(long pk, com.liferay.portal.model.User user)
321         throws com.liferay.portal.SystemException, 
322             com.liferay.portal.NoSuchRoleException, 
323             com.liferay.portal.NoSuchUserException;
324 
325     public void addUsers(long pk, long[] userPKs)
326         throws com.liferay.portal.SystemException, 
327             com.liferay.portal.NoSuchRoleException, 
328             com.liferay.portal.NoSuchUserException;
329 
330     public void addUsers(long pk, java.util.List users)
331         throws com.liferay.portal.SystemException, 
332             com.liferay.portal.NoSuchRoleException, 
333             com.liferay.portal.NoSuchUserException;
334 
335     public void clearUsers(long pk)
336         throws com.liferay.portal.SystemException, 
337             com.liferay.portal.NoSuchRoleException;
338 
339     public void removeUser(long pk, long userPK)
340         throws com.liferay.portal.SystemException, 
341             com.liferay.portal.NoSuchRoleException, 
342             com.liferay.portal.NoSuchUserException;
343 
344     public void removeUser(long pk, com.liferay.portal.model.User user)
345         throws com.liferay.portal.SystemException, 
346             com.liferay.portal.NoSuchRoleException, 
347             com.liferay.portal.NoSuchUserException;
348 
349     public void removeUsers(long pk, long[] userPKs)
350         throws com.liferay.portal.SystemException, 
351             com.liferay.portal.NoSuchRoleException, 
352             com.liferay.portal.NoSuchUserException;
353 
354     public void removeUsers(long pk, java.util.List users)
355         throws com.liferay.portal.SystemException, 
356             com.liferay.portal.NoSuchRoleException, 
357             com.liferay.portal.NoSuchUserException;
358 
359     public void setUsers(long pk, long[] userPKs)
360         throws com.liferay.portal.SystemException, 
361             com.liferay.portal.NoSuchRoleException, 
362             com.liferay.portal.NoSuchUserException;
363 
364     public void setUsers(long pk, java.util.List users)
365         throws com.liferay.portal.SystemException, 
366             com.liferay.portal.NoSuchRoleException, 
367             com.liferay.portal.NoSuchUserException;
368 }