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 java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
124         java.lang.String subtype) throws com.liferay.portal.SystemException;
125 
126     public java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
127         java.lang.String subtype, int start, int end)
128         throws com.liferay.portal.SystemException;
129 
130     public java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
131         java.lang.String subtype, int start, int end,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.SystemException;
134 
135     public com.liferay.portal.model.Role findByT_S_First(int type,
136         java.lang.String subtype,
137         com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.NoSuchRoleException,
139             com.liferay.portal.SystemException;
140 
141     public com.liferay.portal.model.Role findByT_S_Last(int type,
142         java.lang.String subtype,
143         com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.NoSuchRoleException,
145             com.liferay.portal.SystemException;
146 
147     public com.liferay.portal.model.Role[] findByT_S_PrevAndNext(long roleId,
148         int type, java.lang.String subtype,
149         com.liferay.portal.kernel.util.OrderByComparator obc)
150         throws com.liferay.portal.NoSuchRoleException,
151             com.liferay.portal.SystemException;
152 
153     public com.liferay.portal.model.Role findByC_C_C(long companyId,
154         long classNameId, long classPK)
155         throws com.liferay.portal.NoSuchRoleException,
156             com.liferay.portal.SystemException;
157 
158     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
159         long classNameId, long classPK)
160         throws com.liferay.portal.SystemException;
161 
162     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
163         long classNameId, long classPK, boolean retrieveFromCache)
164         throws com.liferay.portal.SystemException;
165 
166     public java.util.List<Object> findWithDynamicQuery(
167         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
168         throws com.liferay.portal.SystemException;
169 
170     public java.util.List<Object> findWithDynamicQuery(
171         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
172         int end) throws com.liferay.portal.SystemException;
173 
174     public java.util.List<com.liferay.portal.model.Role> findAll()
175         throws com.liferay.portal.SystemException;
176 
177     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
178         int end) throws com.liferay.portal.SystemException;
179 
180     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
181         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.SystemException;
183 
184     public void removeByCompanyId(long companyId)
185         throws com.liferay.portal.SystemException;
186 
187     public void removeByC_N(long companyId, java.lang.String name)
188         throws com.liferay.portal.NoSuchRoleException,
189             com.liferay.portal.SystemException;
190 
191     public void removeByT_S(int type, java.lang.String subtype)
192         throws com.liferay.portal.SystemException;
193 
194     public void removeByC_C_C(long companyId, long classNameId, long classPK)
195         throws com.liferay.portal.NoSuchRoleException,
196             com.liferay.portal.SystemException;
197 
198     public void removeAll() throws com.liferay.portal.SystemException;
199 
200     public int countByCompanyId(long companyId)
201         throws com.liferay.portal.SystemException;
202 
203     public int countByC_N(long companyId, java.lang.String name)
204         throws com.liferay.portal.SystemException;
205 
206     public int countByT_S(int type, java.lang.String subtype)
207         throws com.liferay.portal.SystemException;
208 
209     public int countByC_C_C(long companyId, long classNameId, long classPK)
210         throws com.liferay.portal.SystemException;
211 
212     public int countAll() throws com.liferay.portal.SystemException;
213 
214     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
215         throws com.liferay.portal.SystemException;
216 
217     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
218         int start, int end) throws com.liferay.portal.SystemException;
219 
220     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
221         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
222         throws com.liferay.portal.SystemException;
223 
224     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
225 
226     public boolean containsGroup(long pk, long groupPK)
227         throws com.liferay.portal.SystemException;
228 
229     public boolean containsGroups(long pk)
230         throws com.liferay.portal.SystemException;
231 
232     public void addGroup(long pk, long groupPK)
233         throws com.liferay.portal.SystemException;
234 
235     public void addGroup(long pk, com.liferay.portal.model.Group group)
236         throws com.liferay.portal.SystemException;
237 
238     public void addGroups(long pk, long[] groupPKs)
239         throws com.liferay.portal.SystemException;
240 
241     public void addGroups(long pk,
242         java.util.List<com.liferay.portal.model.Group> groups)
243         throws com.liferay.portal.SystemException;
244 
245     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
246 
247     public void removeGroup(long pk, long groupPK)
248         throws com.liferay.portal.SystemException;
249 
250     public void removeGroup(long pk, com.liferay.portal.model.Group group)
251         throws com.liferay.portal.SystemException;
252 
253     public void removeGroups(long pk, long[] groupPKs)
254         throws com.liferay.portal.SystemException;
255 
256     public void removeGroups(long pk,
257         java.util.List<com.liferay.portal.model.Group> groups)
258         throws com.liferay.portal.SystemException;
259 
260     public void setGroups(long pk, long[] groupPKs)
261         throws com.liferay.portal.SystemException;
262 
263     public void setGroups(long pk,
264         java.util.List<com.liferay.portal.model.Group> groups)
265         throws com.liferay.portal.SystemException;
266 
267     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
268         long pk) throws com.liferay.portal.SystemException;
269 
270     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
271         long pk, int start, int end) throws com.liferay.portal.SystemException;
272 
273     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
274         long pk, int start, int end,
275         com.liferay.portal.kernel.util.OrderByComparator obc)
276         throws com.liferay.portal.SystemException;
277 
278     public int getPermissionsSize(long pk)
279         throws com.liferay.portal.SystemException;
280 
281     public boolean containsPermission(long pk, long permissionPK)
282         throws com.liferay.portal.SystemException;
283 
284     public boolean containsPermissions(long pk)
285         throws com.liferay.portal.SystemException;
286 
287     public void addPermission(long pk, long permissionPK)
288         throws com.liferay.portal.SystemException;
289 
290     public void addPermission(long pk,
291         com.liferay.portal.model.Permission permission)
292         throws com.liferay.portal.SystemException;
293 
294     public void addPermissions(long pk, long[] permissionPKs)
295         throws com.liferay.portal.SystemException;
296 
297     public void addPermissions(long pk,
298         java.util.List<com.liferay.portal.model.Permission> permissions)
299         throws com.liferay.portal.SystemException;
300 
301     public void clearPermissions(long pk)
302         throws com.liferay.portal.SystemException;
303 
304     public void removePermission(long pk, long permissionPK)
305         throws com.liferay.portal.SystemException;
306 
307     public void removePermission(long pk,
308         com.liferay.portal.model.Permission permission)
309         throws com.liferay.portal.SystemException;
310 
311     public void removePermissions(long pk, long[] permissionPKs)
312         throws com.liferay.portal.SystemException;
313 
314     public void removePermissions(long pk,
315         java.util.List<com.liferay.portal.model.Permission> permissions)
316         throws com.liferay.portal.SystemException;
317 
318     public void setPermissions(long pk, long[] permissionPKs)
319         throws com.liferay.portal.SystemException;
320 
321     public void setPermissions(long pk,
322         java.util.List<com.liferay.portal.model.Permission> permissions)
323         throws com.liferay.portal.SystemException;
324 
325     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
326         throws com.liferay.portal.SystemException;
327 
328     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
329         int start, int end) throws com.liferay.portal.SystemException;
330 
331     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
332         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
333         throws com.liferay.portal.SystemException;
334 
335     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
336 
337     public boolean containsUser(long pk, long userPK)
338         throws com.liferay.portal.SystemException;
339 
340     public boolean containsUsers(long pk)
341         throws com.liferay.portal.SystemException;
342 
343     public void addUser(long pk, long userPK)
344         throws com.liferay.portal.SystemException;
345 
346     public void addUser(long pk, com.liferay.portal.model.User user)
347         throws com.liferay.portal.SystemException;
348 
349     public void addUsers(long pk, long[] userPKs)
350         throws com.liferay.portal.SystemException;
351 
352     public void addUsers(long pk,
353         java.util.List<com.liferay.portal.model.User> users)
354         throws com.liferay.portal.SystemException;
355 
356     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
357 
358     public void removeUser(long pk, long userPK)
359         throws com.liferay.portal.SystemException;
360 
361     public void removeUser(long pk, com.liferay.portal.model.User user)
362         throws com.liferay.portal.SystemException;
363 
364     public void removeUsers(long pk, long[] userPKs)
365         throws com.liferay.portal.SystemException;
366 
367     public void removeUsers(long pk,
368         java.util.List<com.liferay.portal.model.User> users)
369         throws com.liferay.portal.SystemException;
370 
371     public void setUsers(long pk, long[] userPKs)
372         throws com.liferay.portal.SystemException;
373 
374     public void setUsers(long pk,
375         java.util.List<com.liferay.portal.model.User> users)
376         throws com.liferay.portal.SystemException;
377 }