1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="RolePersistence.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public interface RolePersistence extends BasePersistence {
29      public void cacheResult(com.liferay.portal.model.Role role);
30  
31      public void cacheResult(java.util.List<com.liferay.portal.model.Role> roles);
32  
33      public void clearCache();
34  
35      public com.liferay.portal.model.Role create(long roleId);
36  
37      public com.liferay.portal.model.Role remove(long roleId)
38          throws com.liferay.portal.NoSuchRoleException,
39              com.liferay.portal.SystemException;
40  
41      public com.liferay.portal.model.Role remove(
42          com.liferay.portal.model.Role role)
43          throws com.liferay.portal.SystemException;
44  
45      /**
46       * @deprecated Use <code>update(Role role, boolean merge)</code>.
47       */
48      public com.liferay.portal.model.Role update(
49          com.liferay.portal.model.Role role)
50          throws com.liferay.portal.SystemException;
51  
52      /**
53       * Add, update, or merge, the entity. This method also calls the model
54       * listeners to trigger the proper events associated with adding, deleting,
55       * or updating an entity.
56       *
57       * @param        role the entity to add, update, or merge
58       * @param        merge boolean value for whether to merge the entity. The
59       *                default value is false. Setting merge to true is more
60       *                expensive and should only be true when role is
61       *                transient. See LEP-5473 for a detailed discussion of this
62       *                method.
63       * @return        true if the portlet can be displayed via Ajax
64       */
65      public com.liferay.portal.model.Role update(
66          com.liferay.portal.model.Role role, boolean merge)
67          throws com.liferay.portal.SystemException;
68  
69      public com.liferay.portal.model.Role updateImpl(
70          com.liferay.portal.model.Role role, boolean merge)
71          throws com.liferay.portal.SystemException;
72  
73      public com.liferay.portal.model.Role findByPrimaryKey(long roleId)
74          throws com.liferay.portal.NoSuchRoleException,
75              com.liferay.portal.SystemException;
76  
77      public com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
78          throws com.liferay.portal.SystemException;
79  
80      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
81          long companyId) throws com.liferay.portal.SystemException;
82  
83      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
84          long companyId, int start, int end)
85          throws com.liferay.portal.SystemException;
86  
87      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
88          long companyId, int start, int end,
89          com.liferay.portal.kernel.util.OrderByComparator obc)
90          throws com.liferay.portal.SystemException;
91  
92      public com.liferay.portal.model.Role findByCompanyId_First(long companyId,
93          com.liferay.portal.kernel.util.OrderByComparator obc)
94          throws com.liferay.portal.NoSuchRoleException,
95              com.liferay.portal.SystemException;
96  
97      public com.liferay.portal.model.Role findByCompanyId_Last(long companyId,
98          com.liferay.portal.kernel.util.OrderByComparator obc)
99          throws com.liferay.portal.NoSuchRoleException,
100             com.liferay.portal.SystemException;
101 
102     public com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
103         long roleId, long companyId,
104         com.liferay.portal.kernel.util.OrderByComparator obc)
105         throws com.liferay.portal.NoSuchRoleException,
106             com.liferay.portal.SystemException;
107 
108     public com.liferay.portal.model.Role findByC_N(long companyId,
109         java.lang.String name)
110         throws com.liferay.portal.NoSuchRoleException,
111             com.liferay.portal.SystemException;
112 
113     public com.liferay.portal.model.Role fetchByC_N(long companyId,
114         java.lang.String name) throws com.liferay.portal.SystemException;
115 
116     public com.liferay.portal.model.Role fetchByC_N(long companyId,
117         java.lang.String name, boolean retrieveFromCache)
118         throws com.liferay.portal.SystemException;
119 
120     public java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
121         java.lang.String subtype) 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, int start, int end)
125         throws com.liferay.portal.SystemException;
126 
127     public java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
128         java.lang.String subtype, int start, int end,
129         com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.SystemException;
131 
132     public com.liferay.portal.model.Role findByT_S_First(int type,
133         java.lang.String subtype,
134         com.liferay.portal.kernel.util.OrderByComparator obc)
135         throws com.liferay.portal.NoSuchRoleException,
136             com.liferay.portal.SystemException;
137 
138     public com.liferay.portal.model.Role findByT_S_Last(int type,
139         java.lang.String subtype,
140         com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.NoSuchRoleException,
142             com.liferay.portal.SystemException;
143 
144     public com.liferay.portal.model.Role[] findByT_S_PrevAndNext(long roleId,
145         int type, java.lang.String subtype,
146         com.liferay.portal.kernel.util.OrderByComparator obc)
147         throws com.liferay.portal.NoSuchRoleException,
148             com.liferay.portal.SystemException;
149 
150     public com.liferay.portal.model.Role findByC_C_C(long companyId,
151         long classNameId, long classPK)
152         throws com.liferay.portal.NoSuchRoleException,
153             com.liferay.portal.SystemException;
154 
155     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
156         long classNameId, long classPK)
157         throws com.liferay.portal.SystemException;
158 
159     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
160         long classNameId, long classPK, boolean retrieveFromCache)
161         throws com.liferay.portal.SystemException;
162 
163     public java.util.List<Object> findWithDynamicQuery(
164         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
165         throws com.liferay.portal.SystemException;
166 
167     public java.util.List<Object> findWithDynamicQuery(
168         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
169         int end) throws com.liferay.portal.SystemException;
170 
171     public java.util.List<com.liferay.portal.model.Role> findAll()
172         throws com.liferay.portal.SystemException;
173 
174     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
175         int end) throws com.liferay.portal.SystemException;
176 
177     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
178         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.SystemException;
180 
181     public void removeByCompanyId(long companyId)
182         throws com.liferay.portal.SystemException;
183 
184     public void removeByC_N(long companyId, java.lang.String name)
185         throws com.liferay.portal.NoSuchRoleException,
186             com.liferay.portal.SystemException;
187 
188     public void removeByT_S(int type, java.lang.String subtype)
189         throws com.liferay.portal.SystemException;
190 
191     public void removeByC_C_C(long companyId, long classNameId, long classPK)
192         throws com.liferay.portal.NoSuchRoleException,
193             com.liferay.portal.SystemException;
194 
195     public void removeAll() throws com.liferay.portal.SystemException;
196 
197     public int countByCompanyId(long companyId)
198         throws com.liferay.portal.SystemException;
199 
200     public int countByC_N(long companyId, java.lang.String name)
201         throws com.liferay.portal.SystemException;
202 
203     public int countByT_S(int type, java.lang.String subtype)
204         throws com.liferay.portal.SystemException;
205 
206     public int countByC_C_C(long companyId, long classNameId, long classPK)
207         throws com.liferay.portal.SystemException;
208 
209     public int countAll() throws com.liferay.portal.SystemException;
210 
211     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
212         throws com.liferay.portal.SystemException;
213 
214     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
215         int start, int end) throws com.liferay.portal.SystemException;
216 
217     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
218         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
219         throws com.liferay.portal.SystemException;
220 
221     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
222 
223     public boolean containsGroup(long pk, long groupPK)
224         throws com.liferay.portal.SystemException;
225 
226     public boolean containsGroups(long pk)
227         throws com.liferay.portal.SystemException;
228 
229     public void addGroup(long pk, long groupPK)
230         throws com.liferay.portal.SystemException;
231 
232     public void addGroup(long pk, com.liferay.portal.model.Group group)
233         throws com.liferay.portal.SystemException;
234 
235     public void addGroups(long pk, long[] groupPKs)
236         throws com.liferay.portal.SystemException;
237 
238     public void addGroups(long pk,
239         java.util.List<com.liferay.portal.model.Group> groups)
240         throws com.liferay.portal.SystemException;
241 
242     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
243 
244     public void removeGroup(long pk, long groupPK)
245         throws com.liferay.portal.SystemException;
246 
247     public void removeGroup(long pk, com.liferay.portal.model.Group group)
248         throws com.liferay.portal.SystemException;
249 
250     public void removeGroups(long pk, long[] groupPKs)
251         throws com.liferay.portal.SystemException;
252 
253     public void removeGroups(long pk,
254         java.util.List<com.liferay.portal.model.Group> groups)
255         throws com.liferay.portal.SystemException;
256 
257     public void setGroups(long pk, long[] groupPKs)
258         throws com.liferay.portal.SystemException;
259 
260     public void setGroups(long pk,
261         java.util.List<com.liferay.portal.model.Group> groups)
262         throws com.liferay.portal.SystemException;
263 
264     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
265         long pk) throws com.liferay.portal.SystemException;
266 
267     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
268         long pk, int start, int end) throws com.liferay.portal.SystemException;
269 
270     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
271         long pk, int start, int end,
272         com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.SystemException;
274 
275     public int getPermissionsSize(long pk)
276         throws com.liferay.portal.SystemException;
277 
278     public boolean containsPermission(long pk, long permissionPK)
279         throws com.liferay.portal.SystemException;
280 
281     public boolean containsPermissions(long pk)
282         throws com.liferay.portal.SystemException;
283 
284     public void addPermission(long pk, long permissionPK)
285         throws com.liferay.portal.SystemException;
286 
287     public void addPermission(long pk,
288         com.liferay.portal.model.Permission permission)
289         throws com.liferay.portal.SystemException;
290 
291     public void addPermissions(long pk, long[] permissionPKs)
292         throws com.liferay.portal.SystemException;
293 
294     public void addPermissions(long pk,
295         java.util.List<com.liferay.portal.model.Permission> permissions)
296         throws com.liferay.portal.SystemException;
297 
298     public void clearPermissions(long pk)
299         throws com.liferay.portal.SystemException;
300 
301     public void removePermission(long pk, long permissionPK)
302         throws com.liferay.portal.SystemException;
303 
304     public void removePermission(long pk,
305         com.liferay.portal.model.Permission permission)
306         throws com.liferay.portal.SystemException;
307 
308     public void removePermissions(long pk, long[] permissionPKs)
309         throws com.liferay.portal.SystemException;
310 
311     public void removePermissions(long pk,
312         java.util.List<com.liferay.portal.model.Permission> permissions)
313         throws com.liferay.portal.SystemException;
314 
315     public void setPermissions(long pk, long[] permissionPKs)
316         throws com.liferay.portal.SystemException;
317 
318     public void setPermissions(long pk,
319         java.util.List<com.liferay.portal.model.Permission> permissions)
320         throws com.liferay.portal.SystemException;
321 
322     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
323         throws com.liferay.portal.SystemException;
324 
325     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
326         int start, int end) throws com.liferay.portal.SystemException;
327 
328     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
329         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
330         throws com.liferay.portal.SystemException;
331 
332     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
333 
334     public boolean containsUser(long pk, long userPK)
335         throws com.liferay.portal.SystemException;
336 
337     public boolean containsUsers(long pk)
338         throws com.liferay.portal.SystemException;
339 
340     public void addUser(long pk, long userPK)
341         throws com.liferay.portal.SystemException;
342 
343     public void addUser(long pk, com.liferay.portal.model.User user)
344         throws com.liferay.portal.SystemException;
345 
346     public void addUsers(long pk, long[] userPKs)
347         throws com.liferay.portal.SystemException;
348 
349     public void addUsers(long pk,
350         java.util.List<com.liferay.portal.model.User> users)
351         throws com.liferay.portal.SystemException;
352 
353     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
354 
355     public void removeUser(long pk, long userPK)
356         throws com.liferay.portal.SystemException;
357 
358     public void removeUser(long pk, com.liferay.portal.model.User user)
359         throws com.liferay.portal.SystemException;
360 
361     public void removeUsers(long pk, long[] userPKs)
362         throws com.liferay.portal.SystemException;
363 
364     public void removeUsers(long pk,
365         java.util.List<com.liferay.portal.model.User> users)
366         throws com.liferay.portal.SystemException;
367 
368     public void setUsers(long pk, long[] userPKs)
369         throws com.liferay.portal.SystemException;
370 
371     public void setUsers(long pk,
372         java.util.List<com.liferay.portal.model.User> users)
373         throws com.liferay.portal.SystemException;
374 }