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