1   /**
2    * Copyright (c) 2000-2008 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      /**
43       * @deprecated Use <code>update(Role role, boolean merge)</code>.
44       */
45      public com.liferay.portal.model.Role update(
46          com.liferay.portal.model.Role role)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * Add, update, or merge, the entity. This method also calls the model
51       * listeners to trigger the proper events associated with adding, deleting,
52       * or updating an entity.
53       *
54       * @param        role the entity to add, update, or merge
55       * @param        merge boolean value for whether to merge the entity. The
56       *                default value is false. Setting merge to true is more
57       *                expensive and should only be true when role is
58       *                transient. See LEP-5473 for a detailed discussion of this
59       *                method.
60       * @return        true if the portlet can be displayed via Ajax
61       */
62      public com.liferay.portal.model.Role update(
63          com.liferay.portal.model.Role role, boolean merge)
64          throws com.liferay.portal.SystemException;
65  
66      public com.liferay.portal.model.Role updateImpl(
67          com.liferay.portal.model.Role role, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Role findByPrimaryKey(long roleId)
71          throws com.liferay.portal.SystemException,
72              com.liferay.portal.NoSuchRoleException;
73  
74      public com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
75          throws com.liferay.portal.SystemException;
76  
77      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
78          long companyId) throws com.liferay.portal.SystemException;
79  
80      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
81          long companyId, int begin, int end)
82          throws com.liferay.portal.SystemException;
83  
84      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
85          long companyId, int begin, int end,
86          com.liferay.portal.kernel.util.OrderByComparator obc)
87          throws com.liferay.portal.SystemException;
88  
89      public com.liferay.portal.model.Role findByCompanyId_First(long companyId,
90          com.liferay.portal.kernel.util.OrderByComparator obc)
91          throws com.liferay.portal.SystemException,
92              com.liferay.portal.NoSuchRoleException;
93  
94      public com.liferay.portal.model.Role findByCompanyId_Last(long companyId,
95          com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.SystemException,
97              com.liferay.portal.NoSuchRoleException;
98  
99      public com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
100         long roleId, long companyId,
101         com.liferay.portal.kernel.util.OrderByComparator obc)
102         throws com.liferay.portal.SystemException,
103             com.liferay.portal.NoSuchRoleException;
104 
105     public com.liferay.portal.model.Role findByC_N(long companyId,
106         java.lang.String name)
107         throws com.liferay.portal.SystemException,
108             com.liferay.portal.NoSuchRoleException;
109 
110     public com.liferay.portal.model.Role fetchByC_N(long companyId,
111         java.lang.String name) throws com.liferay.portal.SystemException;
112 
113     public com.liferay.portal.model.Role findByC_C_C(long companyId,
114         long classNameId, long classPK)
115         throws com.liferay.portal.SystemException,
116             com.liferay.portal.NoSuchRoleException;
117 
118     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
119         long classNameId, long classPK)
120         throws com.liferay.portal.SystemException;
121 
122     public java.util.List<com.liferay.portal.model.Role> findWithDynamicQuery(
123         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
124         throws com.liferay.portal.SystemException;
125 
126     public java.util.List<com.liferay.portal.model.Role> findWithDynamicQuery(
127         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
128         int begin, int end) throws com.liferay.portal.SystemException;
129 
130     public java.util.List<com.liferay.portal.model.Role> findAll()
131         throws com.liferay.portal.SystemException;
132 
133     public java.util.List<com.liferay.portal.model.Role> findAll(int begin,
134         int end) throws com.liferay.portal.SystemException;
135 
136     public java.util.List<com.liferay.portal.model.Role> findAll(int begin,
137         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.SystemException;
139 
140     public void removeByCompanyId(long companyId)
141         throws com.liferay.portal.SystemException;
142 
143     public void removeByC_N(long companyId, java.lang.String name)
144         throws com.liferay.portal.SystemException,
145             com.liferay.portal.NoSuchRoleException;
146 
147     public void removeByC_C_C(long companyId, long classNameId, long classPK)
148         throws com.liferay.portal.SystemException,
149             com.liferay.portal.NoSuchRoleException;
150 
151     public void removeAll() throws com.liferay.portal.SystemException;
152 
153     public int countByCompanyId(long companyId)
154         throws com.liferay.portal.SystemException;
155 
156     public int countByC_N(long companyId, java.lang.String name)
157         throws com.liferay.portal.SystemException;
158 
159     public int countByC_C_C(long companyId, long classNameId, long classPK)
160         throws com.liferay.portal.SystemException;
161 
162     public int countAll() throws com.liferay.portal.SystemException;
163 
164     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portal.NoSuchRoleException;
167 
168     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
169         int begin, int end)
170         throws com.liferay.portal.SystemException,
171             com.liferay.portal.NoSuchRoleException;
172 
173     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
174         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
175         throws com.liferay.portal.SystemException,
176             com.liferay.portal.NoSuchRoleException;
177 
178     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
179 
180     public boolean containsGroup(long pk, long groupPK)
181         throws com.liferay.portal.SystemException;
182 
183     public boolean containsGroups(long pk)
184         throws com.liferay.portal.SystemException;
185 
186     public void addGroup(long pk, long groupPK)
187         throws com.liferay.portal.SystemException,
188             com.liferay.portal.NoSuchGroupException,
189             com.liferay.portal.NoSuchRoleException;
190 
191     public void addGroup(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 addGroups(long pk, long[] groupPKs)
197         throws com.liferay.portal.SystemException,
198             com.liferay.portal.NoSuchGroupException,
199             com.liferay.portal.NoSuchRoleException;
200 
201     public void addGroups(long pk,
202         java.util.List<com.liferay.portal.model.Group> groups)
203         throws com.liferay.portal.SystemException,
204             com.liferay.portal.NoSuchGroupException,
205             com.liferay.portal.NoSuchRoleException;
206 
207     public void clearGroups(long pk)
208         throws com.liferay.portal.SystemException,
209             com.liferay.portal.NoSuchRoleException;
210 
211     public void removeGroup(long pk, long groupPK)
212         throws com.liferay.portal.SystemException,
213             com.liferay.portal.NoSuchGroupException,
214             com.liferay.portal.NoSuchRoleException;
215 
216     public void removeGroup(long pk, com.liferay.portal.model.Group group)
217         throws com.liferay.portal.SystemException,
218             com.liferay.portal.NoSuchGroupException,
219             com.liferay.portal.NoSuchRoleException;
220 
221     public void removeGroups(long pk, long[] groupPKs)
222         throws com.liferay.portal.SystemException,
223             com.liferay.portal.NoSuchGroupException,
224             com.liferay.portal.NoSuchRoleException;
225 
226     public void removeGroups(long pk,
227         java.util.List<com.liferay.portal.model.Group> groups)
228         throws com.liferay.portal.SystemException,
229             com.liferay.portal.NoSuchGroupException,
230             com.liferay.portal.NoSuchRoleException;
231 
232     public void setGroups(long pk, long[] groupPKs)
233         throws com.liferay.portal.SystemException,
234             com.liferay.portal.NoSuchGroupException,
235             com.liferay.portal.NoSuchRoleException;
236 
237     public void setGroups(long pk,
238         java.util.List<com.liferay.portal.model.Group> groups)
239         throws com.liferay.portal.SystemException,
240             com.liferay.portal.NoSuchGroupException,
241             com.liferay.portal.NoSuchRoleException;
242 
243     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
244         long pk)
245         throws com.liferay.portal.SystemException,
246             com.liferay.portal.NoSuchRoleException;
247 
248     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
249         long pk, int begin, int end)
250         throws com.liferay.portal.SystemException,
251             com.liferay.portal.NoSuchRoleException;
252 
253     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
254         long pk, int begin, int end,
255         com.liferay.portal.kernel.util.OrderByComparator obc)
256         throws com.liferay.portal.SystemException,
257             com.liferay.portal.NoSuchRoleException;
258 
259     public int getPermissionsSize(long pk)
260         throws com.liferay.portal.SystemException;
261 
262     public boolean containsPermission(long pk, long permissionPK)
263         throws com.liferay.portal.SystemException;
264 
265     public boolean containsPermissions(long pk)
266         throws com.liferay.portal.SystemException;
267 
268     public void addPermission(long pk, long permissionPK)
269         throws com.liferay.portal.SystemException,
270             com.liferay.portal.NoSuchPermissionException,
271             com.liferay.portal.NoSuchRoleException;
272 
273     public void addPermission(long pk,
274         com.liferay.portal.model.Permission permission)
275         throws com.liferay.portal.SystemException,
276             com.liferay.portal.NoSuchPermissionException,
277             com.liferay.portal.NoSuchRoleException;
278 
279     public void addPermissions(long pk, long[] permissionPKs)
280         throws com.liferay.portal.SystemException,
281             com.liferay.portal.NoSuchPermissionException,
282             com.liferay.portal.NoSuchRoleException;
283 
284     public void addPermissions(long pk,
285         java.util.List<com.liferay.portal.model.Permission> permissions)
286         throws com.liferay.portal.SystemException,
287             com.liferay.portal.NoSuchPermissionException,
288             com.liferay.portal.NoSuchRoleException;
289 
290     public void clearPermissions(long pk)
291         throws com.liferay.portal.SystemException,
292             com.liferay.portal.NoSuchRoleException;
293 
294     public void removePermission(long pk, long permissionPK)
295         throws com.liferay.portal.SystemException,
296             com.liferay.portal.NoSuchPermissionException,
297             com.liferay.portal.NoSuchRoleException;
298 
299     public void removePermission(long pk,
300         com.liferay.portal.model.Permission permission)
301         throws com.liferay.portal.SystemException,
302             com.liferay.portal.NoSuchPermissionException,
303             com.liferay.portal.NoSuchRoleException;
304 
305     public void removePermissions(long pk, long[] permissionPKs)
306         throws com.liferay.portal.SystemException,
307             com.liferay.portal.NoSuchPermissionException,
308             com.liferay.portal.NoSuchRoleException;
309 
310     public void removePermissions(long pk,
311         java.util.List<com.liferay.portal.model.Permission> permissions)
312         throws com.liferay.portal.SystemException,
313             com.liferay.portal.NoSuchPermissionException,
314             com.liferay.portal.NoSuchRoleException;
315 
316     public void setPermissions(long pk, long[] permissionPKs)
317         throws com.liferay.portal.SystemException,
318             com.liferay.portal.NoSuchPermissionException,
319             com.liferay.portal.NoSuchRoleException;
320 
321     public void setPermissions(long pk,
322         java.util.List<com.liferay.portal.model.Permission> permissions)
323         throws com.liferay.portal.SystemException,
324             com.liferay.portal.NoSuchPermissionException,
325             com.liferay.portal.NoSuchRoleException;
326 
327     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
328         throws com.liferay.portal.SystemException,
329             com.liferay.portal.NoSuchRoleException;
330 
331     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
332         int begin, int end)
333         throws com.liferay.portal.SystemException,
334             com.liferay.portal.NoSuchRoleException;
335 
336     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
337         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
338         throws com.liferay.portal.SystemException,
339             com.liferay.portal.NoSuchRoleException;
340 
341     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
342 
343     public boolean containsUser(long pk, long userPK)
344         throws com.liferay.portal.SystemException;
345 
346     public boolean containsUsers(long pk)
347         throws com.liferay.portal.SystemException;
348 
349     public void addUser(long pk, long userPK)
350         throws com.liferay.portal.SystemException,
351             com.liferay.portal.NoSuchRoleException,
352             com.liferay.portal.NoSuchUserException;
353 
354     public void addUser(long pk, com.liferay.portal.model.User user)
355         throws com.liferay.portal.SystemException,
356             com.liferay.portal.NoSuchRoleException,
357             com.liferay.portal.NoSuchUserException;
358 
359     public void addUsers(long pk, long[] userPKs)
360         throws com.liferay.portal.SystemException,
361             com.liferay.portal.NoSuchRoleException,
362             com.liferay.portal.NoSuchUserException;
363 
364     public void addUsers(long pk,
365         java.util.List<com.liferay.portal.model.User> users)
366         throws com.liferay.portal.SystemException,
367             com.liferay.portal.NoSuchRoleException,
368             com.liferay.portal.NoSuchUserException;
369 
370     public void clearUsers(long pk)
371         throws com.liferay.portal.SystemException,
372             com.liferay.portal.NoSuchRoleException;
373 
374     public void removeUser(long pk, long userPK)
375         throws com.liferay.portal.SystemException,
376             com.liferay.portal.NoSuchRoleException,
377             com.liferay.portal.NoSuchUserException;
378 
379     public void removeUser(long pk, com.liferay.portal.model.User user)
380         throws com.liferay.portal.SystemException,
381             com.liferay.portal.NoSuchRoleException,
382             com.liferay.portal.NoSuchUserException;
383 
384     public void removeUsers(long pk, long[] userPKs)
385         throws com.liferay.portal.SystemException,
386             com.liferay.portal.NoSuchRoleException,
387             com.liferay.portal.NoSuchUserException;
388 
389     public void removeUsers(long pk,
390         java.util.List<com.liferay.portal.model.User> users)
391         throws com.liferay.portal.SystemException,
392             com.liferay.portal.NoSuchRoleException,
393             com.liferay.portal.NoSuchUserException;
394 
395     public void setUsers(long pk, long[] userPKs)
396         throws com.liferay.portal.SystemException,
397             com.liferay.portal.NoSuchRoleException,
398             com.liferay.portal.NoSuchUserException;
399 
400     public void setUsers(long pk,
401         java.util.List<com.liferay.portal.model.User> users)
402         throws com.liferay.portal.SystemException,
403             com.liferay.portal.NoSuchRoleException,
404             com.liferay.portal.NoSuchUserException;
405 }