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.NoSuchRoleException,
36              com.liferay.portal.SystemException;
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.NoSuchRoleException,
72              com.liferay.portal.SystemException;
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 start, int end)
82          throws com.liferay.portal.SystemException;
83  
84      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
85          long companyId, int start, 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.NoSuchRoleException,
92              com.liferay.portal.SystemException;
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.NoSuchRoleException,
97              com.liferay.portal.SystemException;
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.NoSuchRoleException,
103             com.liferay.portal.SystemException;
104 
105     public com.liferay.portal.model.Role findByC_N(long companyId,
106         java.lang.String name)
107         throws com.liferay.portal.NoSuchRoleException,
108             com.liferay.portal.SystemException;
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.NoSuchRoleException,
116             com.liferay.portal.SystemException;
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<Object> findWithDynamicQuery(
123         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
124         throws com.liferay.portal.SystemException;
125 
126     public java.util.List<Object> findWithDynamicQuery(
127         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
128         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 start,
134         int end) throws com.liferay.portal.SystemException;
135 
136     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
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.NoSuchRoleException,
145             com.liferay.portal.SystemException;
146 
147     public void removeByC_C_C(long companyId, long classNameId, long classPK)
148         throws com.liferay.portal.NoSuchRoleException,
149             com.liferay.portal.SystemException;
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 
167     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
168         int start, int end) throws com.liferay.portal.SystemException;
169 
170     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
171         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException;
173 
174     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
175 
176     public boolean containsGroup(long pk, long groupPK)
177         throws com.liferay.portal.SystemException;
178 
179     public boolean containsGroups(long pk)
180         throws com.liferay.portal.SystemException;
181 
182     public void addGroup(long pk, long groupPK)
183         throws com.liferay.portal.SystemException;
184 
185     public void addGroup(long pk, com.liferay.portal.model.Group group)
186         throws com.liferay.portal.SystemException;
187 
188     public void addGroups(long pk, long[] groupPKs)
189         throws com.liferay.portal.SystemException;
190 
191     public void addGroups(long pk,
192         java.util.List<com.liferay.portal.model.Group> groups)
193         throws com.liferay.portal.SystemException;
194 
195     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
196 
197     public void removeGroup(long pk, long groupPK)
198         throws com.liferay.portal.SystemException;
199 
200     public void removeGroup(long pk, com.liferay.portal.model.Group group)
201         throws com.liferay.portal.SystemException;
202 
203     public void removeGroups(long pk, long[] groupPKs)
204         throws com.liferay.portal.SystemException;
205 
206     public void removeGroups(long pk,
207         java.util.List<com.liferay.portal.model.Group> groups)
208         throws com.liferay.portal.SystemException;
209 
210     public void setGroups(long pk, long[] groupPKs)
211         throws com.liferay.portal.SystemException;
212 
213     public void setGroups(long pk,
214         java.util.List<com.liferay.portal.model.Group> groups)
215         throws com.liferay.portal.SystemException;
216 
217     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
218         long pk) throws com.liferay.portal.SystemException;
219 
220     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
221         long pk, int start, int end) throws com.liferay.portal.SystemException;
222 
223     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
224         long pk, int start, int end,
225         com.liferay.portal.kernel.util.OrderByComparator obc)
226         throws com.liferay.portal.SystemException;
227 
228     public int getPermissionsSize(long pk)
229         throws com.liferay.portal.SystemException;
230 
231     public boolean containsPermission(long pk, long permissionPK)
232         throws com.liferay.portal.SystemException;
233 
234     public boolean containsPermissions(long pk)
235         throws com.liferay.portal.SystemException;
236 
237     public void addPermission(long pk, long permissionPK)
238         throws com.liferay.portal.SystemException;
239 
240     public void addPermission(long pk,
241         com.liferay.portal.model.Permission permission)
242         throws com.liferay.portal.SystemException;
243 
244     public void addPermissions(long pk, long[] permissionPKs)
245         throws com.liferay.portal.SystemException;
246 
247     public void addPermissions(long pk,
248         java.util.List<com.liferay.portal.model.Permission> permissions)
249         throws com.liferay.portal.SystemException;
250 
251     public void clearPermissions(long pk)
252         throws com.liferay.portal.SystemException;
253 
254     public void removePermission(long pk, long permissionPK)
255         throws com.liferay.portal.SystemException;
256 
257     public void removePermission(long pk,
258         com.liferay.portal.model.Permission permission)
259         throws com.liferay.portal.SystemException;
260 
261     public void removePermissions(long pk, long[] permissionPKs)
262         throws com.liferay.portal.SystemException;
263 
264     public void removePermissions(long pk,
265         java.util.List<com.liferay.portal.model.Permission> permissions)
266         throws com.liferay.portal.SystemException;
267 
268     public void setPermissions(long pk, long[] permissionPKs)
269         throws com.liferay.portal.SystemException;
270 
271     public void setPermissions(long pk,
272         java.util.List<com.liferay.portal.model.Permission> permissions)
273         throws com.liferay.portal.SystemException;
274 
275     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
276         throws com.liferay.portal.SystemException;
277 
278     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
279         int start, int end) throws com.liferay.portal.SystemException;
280 
281     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
282         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
283         throws com.liferay.portal.SystemException;
284 
285     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
286 
287     public boolean containsUser(long pk, long userPK)
288         throws com.liferay.portal.SystemException;
289 
290     public boolean containsUsers(long pk)
291         throws com.liferay.portal.SystemException;
292 
293     public void addUser(long pk, long userPK)
294         throws com.liferay.portal.SystemException;
295 
296     public void addUser(long pk, com.liferay.portal.model.User user)
297         throws com.liferay.portal.SystemException;
298 
299     public void addUsers(long pk, long[] userPKs)
300         throws com.liferay.portal.SystemException;
301 
302     public void addUsers(long pk,
303         java.util.List<com.liferay.portal.model.User> users)
304         throws com.liferay.portal.SystemException;
305 
306     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
307 
308     public void removeUser(long pk, long userPK)
309         throws com.liferay.portal.SystemException;
310 
311     public void removeUser(long pk, com.liferay.portal.model.User user)
312         throws com.liferay.portal.SystemException;
313 
314     public void removeUsers(long pk, long[] userPKs)
315         throws com.liferay.portal.SystemException;
316 
317     public void removeUsers(long pk,
318         java.util.List<com.liferay.portal.model.User> users)
319         throws com.liferay.portal.SystemException;
320 
321     public void setUsers(long pk, long[] userPKs)
322         throws com.liferay.portal.SystemException;
323 
324     public void setUsers(long pk,
325         java.util.List<com.liferay.portal.model.User> users)
326         throws com.liferay.portal.SystemException;
327 
328     public void registerListener(
329         com.liferay.portal.model.ModelListener listener);
330 
331     public void unregisterListener(
332         com.liferay.portal.model.ModelListener listener);
333 }