1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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 java.util.List<com.liferay.portal.model.Role> findBySubtype(
112         java.lang.String subtype) throws com.liferay.portal.SystemException;
113 
114     public java.util.List<com.liferay.portal.model.Role> findBySubtype(
115         java.lang.String subtype, int start, int end)
116         throws com.liferay.portal.SystemException;
117 
118     public java.util.List<com.liferay.portal.model.Role> findBySubtype(
119         java.lang.String subtype, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException;
122 
123     public com.liferay.portal.model.Role findBySubtype_First(
124         java.lang.String subtype,
125         com.liferay.portal.kernel.util.OrderByComparator obc)
126         throws com.liferay.portal.NoSuchRoleException,
127             com.liferay.portal.SystemException;
128 
129     public com.liferay.portal.model.Role findBySubtype_Last(
130         java.lang.String subtype,
131         com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.NoSuchRoleException,
133             com.liferay.portal.SystemException;
134 
135     public com.liferay.portal.model.Role[] findBySubtype_PrevAndNext(
136         long roleId, 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 findByC_N(long companyId,
142         java.lang.String name)
143         throws com.liferay.portal.NoSuchRoleException,
144             com.liferay.portal.SystemException;
145 
146     public com.liferay.portal.model.Role fetchByC_N(long companyId,
147         java.lang.String name) throws com.liferay.portal.SystemException;
148 
149     public com.liferay.portal.model.Role fetchByC_N(long companyId,
150         java.lang.String name, boolean retrieveFromCache)
151         throws com.liferay.portal.SystemException;
152 
153     public java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
154         java.lang.String subtype) throws com.liferay.portal.SystemException;
155 
156     public java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
157         java.lang.String subtype, int start, int end)
158         throws com.liferay.portal.SystemException;
159 
160     public java.util.List<com.liferay.portal.model.Role> findByT_S(int type,
161         java.lang.String subtype, int start, int end,
162         com.liferay.portal.kernel.util.OrderByComparator obc)
163         throws com.liferay.portal.SystemException;
164 
165     public com.liferay.portal.model.Role findByT_S_First(int type,
166         java.lang.String subtype,
167         com.liferay.portal.kernel.util.OrderByComparator obc)
168         throws com.liferay.portal.NoSuchRoleException,
169             com.liferay.portal.SystemException;
170 
171     public com.liferay.portal.model.Role findByT_S_Last(int type,
172         java.lang.String subtype,
173         com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.NoSuchRoleException,
175             com.liferay.portal.SystemException;
176 
177     public com.liferay.portal.model.Role[] findByT_S_PrevAndNext(long roleId,
178         int type, java.lang.String subtype,
179         com.liferay.portal.kernel.util.OrderByComparator obc)
180         throws com.liferay.portal.NoSuchRoleException,
181             com.liferay.portal.SystemException;
182 
183     public com.liferay.portal.model.Role findByC_C_C(long companyId,
184         long classNameId, long classPK)
185         throws com.liferay.portal.NoSuchRoleException,
186             com.liferay.portal.SystemException;
187 
188     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
189         long classNameId, long classPK)
190         throws com.liferay.portal.SystemException;
191 
192     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
193         long classNameId, long classPK, boolean retrieveFromCache)
194         throws com.liferay.portal.SystemException;
195 
196     public java.util.List<Object> findWithDynamicQuery(
197         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
198         throws com.liferay.portal.SystemException;
199 
200     public java.util.List<Object> findWithDynamicQuery(
201         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
202         int end) throws com.liferay.portal.SystemException;
203 
204     public java.util.List<com.liferay.portal.model.Role> findAll()
205         throws com.liferay.portal.SystemException;
206 
207     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
208         int end) throws com.liferay.portal.SystemException;
209 
210     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
211         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
212         throws com.liferay.portal.SystemException;
213 
214     public void removeByCompanyId(long companyId)
215         throws com.liferay.portal.SystemException;
216 
217     public void removeBySubtype(java.lang.String subtype)
218         throws com.liferay.portal.SystemException;
219 
220     public void removeByC_N(long companyId, java.lang.String name)
221         throws com.liferay.portal.NoSuchRoleException,
222             com.liferay.portal.SystemException;
223 
224     public void removeByT_S(int type, java.lang.String subtype)
225         throws com.liferay.portal.SystemException;
226 
227     public void removeByC_C_C(long companyId, long classNameId, long classPK)
228         throws com.liferay.portal.NoSuchRoleException,
229             com.liferay.portal.SystemException;
230 
231     public void removeAll() throws com.liferay.portal.SystemException;
232 
233     public int countByCompanyId(long companyId)
234         throws com.liferay.portal.SystemException;
235 
236     public int countBySubtype(java.lang.String subtype)
237         throws com.liferay.portal.SystemException;
238 
239     public int countByC_N(long companyId, java.lang.String name)
240         throws com.liferay.portal.SystemException;
241 
242     public int countByT_S(int type, java.lang.String subtype)
243         throws com.liferay.portal.SystemException;
244 
245     public int countByC_C_C(long companyId, long classNameId, long classPK)
246         throws com.liferay.portal.SystemException;
247 
248     public int countAll() throws com.liferay.portal.SystemException;
249 
250     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
251         throws com.liferay.portal.SystemException;
252 
253     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
254         int start, int end) throws com.liferay.portal.SystemException;
255 
256     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
257         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
258         throws com.liferay.portal.SystemException;
259 
260     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
261 
262     public boolean containsGroup(long pk, long groupPK)
263         throws com.liferay.portal.SystemException;
264 
265     public boolean containsGroups(long pk)
266         throws com.liferay.portal.SystemException;
267 
268     public void addGroup(long pk, long groupPK)
269         throws com.liferay.portal.SystemException;
270 
271     public void addGroup(long pk, com.liferay.portal.model.Group group)
272         throws com.liferay.portal.SystemException;
273 
274     public void addGroups(long pk, long[] groupPKs)
275         throws com.liferay.portal.SystemException;
276 
277     public void addGroups(long pk,
278         java.util.List<com.liferay.portal.model.Group> groups)
279         throws com.liferay.portal.SystemException;
280 
281     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
282 
283     public void removeGroup(long pk, long groupPK)
284         throws com.liferay.portal.SystemException;
285 
286     public void removeGroup(long pk, com.liferay.portal.model.Group group)
287         throws com.liferay.portal.SystemException;
288 
289     public void removeGroups(long pk, long[] groupPKs)
290         throws com.liferay.portal.SystemException;
291 
292     public void removeGroups(long pk,
293         java.util.List<com.liferay.portal.model.Group> groups)
294         throws com.liferay.portal.SystemException;
295 
296     public void setGroups(long pk, long[] groupPKs)
297         throws com.liferay.portal.SystemException;
298 
299     public void setGroups(long pk,
300         java.util.List<com.liferay.portal.model.Group> groups)
301         throws com.liferay.portal.SystemException;
302 
303     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
304         long pk) throws com.liferay.portal.SystemException;
305 
306     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
307         long pk, int start, int end) throws com.liferay.portal.SystemException;
308 
309     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
310         long pk, int start, int end,
311         com.liferay.portal.kernel.util.OrderByComparator obc)
312         throws com.liferay.portal.SystemException;
313 
314     public int getPermissionsSize(long pk)
315         throws com.liferay.portal.SystemException;
316 
317     public boolean containsPermission(long pk, long permissionPK)
318         throws com.liferay.portal.SystemException;
319 
320     public boolean containsPermissions(long pk)
321         throws com.liferay.portal.SystemException;
322 
323     public void addPermission(long pk, long permissionPK)
324         throws com.liferay.portal.SystemException;
325 
326     public void addPermission(long pk,
327         com.liferay.portal.model.Permission permission)
328         throws com.liferay.portal.SystemException;
329 
330     public void addPermissions(long pk, long[] permissionPKs)
331         throws com.liferay.portal.SystemException;
332 
333     public void addPermissions(long pk,
334         java.util.List<com.liferay.portal.model.Permission> permissions)
335         throws com.liferay.portal.SystemException;
336 
337     public void clearPermissions(long pk)
338         throws com.liferay.portal.SystemException;
339 
340     public void removePermission(long pk, long permissionPK)
341         throws com.liferay.portal.SystemException;
342 
343     public void removePermission(long pk,
344         com.liferay.portal.model.Permission permission)
345         throws com.liferay.portal.SystemException;
346 
347     public void removePermissions(long pk, long[] permissionPKs)
348         throws com.liferay.portal.SystemException;
349 
350     public void removePermissions(long pk,
351         java.util.List<com.liferay.portal.model.Permission> permissions)
352         throws com.liferay.portal.SystemException;
353 
354     public void setPermissions(long pk, long[] permissionPKs)
355         throws com.liferay.portal.SystemException;
356 
357     public void setPermissions(long pk,
358         java.util.List<com.liferay.portal.model.Permission> permissions)
359         throws com.liferay.portal.SystemException;
360 
361     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
362         throws com.liferay.portal.SystemException;
363 
364     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
365         int start, int end) throws com.liferay.portal.SystemException;
366 
367     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
368         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
369         throws com.liferay.portal.SystemException;
370 
371     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
372 
373     public boolean containsUser(long pk, long userPK)
374         throws com.liferay.portal.SystemException;
375 
376     public boolean containsUsers(long pk)
377         throws com.liferay.portal.SystemException;
378 
379     public void addUser(long pk, long userPK)
380         throws com.liferay.portal.SystemException;
381 
382     public void addUser(long pk, com.liferay.portal.model.User user)
383         throws com.liferay.portal.SystemException;
384 
385     public void addUsers(long pk, long[] userPKs)
386         throws com.liferay.portal.SystemException;
387 
388     public void addUsers(long pk,
389         java.util.List<com.liferay.portal.model.User> users)
390         throws com.liferay.portal.SystemException;
391 
392     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
393 
394     public void removeUser(long pk, long userPK)
395         throws com.liferay.portal.SystemException;
396 
397     public void removeUser(long pk, com.liferay.portal.model.User user)
398         throws com.liferay.portal.SystemException;
399 
400     public void removeUsers(long pk, long[] userPKs)
401         throws com.liferay.portal.SystemException;
402 
403     public void removeUsers(long pk,
404         java.util.List<com.liferay.portal.model.User> users)
405         throws com.liferay.portal.SystemException;
406 
407     public void setUsers(long pk, long[] userPKs)
408         throws com.liferay.portal.SystemException;
409 
410     public void setUsers(long pk,
411         java.util.List<com.liferay.portal.model.User> users)
412         throws com.liferay.portal.SystemException;
413 }