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