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