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="PermissionPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface PermissionPersistence extends BasePersistence {
32      public void cacheResult(com.liferay.portal.model.Permission permission);
33  
34      public void cacheResult(
35          java.util.List<com.liferay.portal.model.Permission> permissions);
36  
37      public void clearCache();
38  
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      public com.liferay.portal.model.Permission findByPrimaryKey(
78          long permissionId)
79          throws com.liferay.portal.NoSuchPermissionException,
80              com.liferay.portal.SystemException;
81  
82      public com.liferay.portal.model.Permission fetchByPrimaryKey(
83          long permissionId) throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
86          long resourceId) throws com.liferay.portal.SystemException;
87  
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      public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
93          long resourceId, int start, int end,
94          com.liferay.portal.kernel.util.OrderByComparator obc)
95          throws com.liferay.portal.SystemException;
96  
97      public com.liferay.portal.model.Permission findByResourceId_First(
98          long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
99          throws com.liferay.portal.NoSuchPermissionException,
100             com.liferay.portal.SystemException;
101 
102     public com.liferay.portal.model.Permission findByResourceId_Last(
103         long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
104         throws com.liferay.portal.NoSuchPermissionException,
105             com.liferay.portal.SystemException;
106 
107     public com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
108         long permissionId, long resourceId,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.NoSuchPermissionException,
111             com.liferay.portal.SystemException;
112 
113     public com.liferay.portal.model.Permission findByA_R(
114         java.lang.String actionId, long resourceId)
115         throws com.liferay.portal.NoSuchPermissionException,
116             com.liferay.portal.SystemException;
117 
118     public com.liferay.portal.model.Permission fetchByA_R(
119         java.lang.String actionId, long resourceId)
120         throws com.liferay.portal.SystemException;
121 
122     public com.liferay.portal.model.Permission fetchByA_R(
123         java.lang.String actionId, long resourceId, boolean retrieveFromCache)
124         throws com.liferay.portal.SystemException;
125 
126     public java.util.List<Object> findWithDynamicQuery(
127         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
128         throws com.liferay.portal.SystemException;
129 
130     public java.util.List<Object> findWithDynamicQuery(
131         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
132         int end) throws com.liferay.portal.SystemException;
133 
134     public java.util.List<com.liferay.portal.model.Permission> findAll()
135         throws com.liferay.portal.SystemException;
136 
137     public java.util.List<com.liferay.portal.model.Permission> findAll(
138         int start, int end) throws com.liferay.portal.SystemException;
139 
140     public java.util.List<com.liferay.portal.model.Permission> findAll(
141         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException;
143 
144     public void removeByResourceId(long resourceId)
145         throws com.liferay.portal.SystemException;
146 
147     public void removeByA_R(java.lang.String actionId, long resourceId)
148         throws com.liferay.portal.NoSuchPermissionException,
149             com.liferay.portal.SystemException;
150 
151     public void removeAll() throws com.liferay.portal.SystemException;
152 
153     public int countByResourceId(long resourceId)
154         throws com.liferay.portal.SystemException;
155 
156     public int countByA_R(java.lang.String actionId, long resourceId)
157         throws com.liferay.portal.SystemException;
158 
159     public int countAll() throws com.liferay.portal.SystemException;
160 
161     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
162         throws com.liferay.portal.SystemException;
163 
164     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
165         int start, int end) throws com.liferay.portal.SystemException;
166 
167     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
168         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
169         throws com.liferay.portal.SystemException;
170 
171     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
172 
173     public boolean containsGroup(long pk, long groupPK)
174         throws com.liferay.portal.SystemException;
175 
176     public boolean containsGroups(long pk)
177         throws com.liferay.portal.SystemException;
178 
179     public void addGroup(long pk, long groupPK)
180         throws com.liferay.portal.SystemException;
181 
182     public void addGroup(long pk, com.liferay.portal.model.Group group)
183         throws com.liferay.portal.SystemException;
184 
185     public void addGroups(long pk, long[] groupPKs)
186         throws com.liferay.portal.SystemException;
187 
188     public void addGroups(long pk,
189         java.util.List<com.liferay.portal.model.Group> groups)
190         throws com.liferay.portal.SystemException;
191 
192     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
193 
194     public void removeGroup(long pk, long groupPK)
195         throws com.liferay.portal.SystemException;
196 
197     public void removeGroup(long pk, com.liferay.portal.model.Group group)
198         throws com.liferay.portal.SystemException;
199 
200     public void removeGroups(long pk, long[] groupPKs)
201         throws com.liferay.portal.SystemException;
202 
203     public void removeGroups(long pk,
204         java.util.List<com.liferay.portal.model.Group> groups)
205         throws com.liferay.portal.SystemException;
206 
207     public void setGroups(long pk, long[] groupPKs)
208         throws com.liferay.portal.SystemException;
209 
210     public void setGroups(long pk,
211         java.util.List<com.liferay.portal.model.Group> groups)
212         throws com.liferay.portal.SystemException;
213 
214     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk)
215         throws com.liferay.portal.SystemException;
216 
217     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
218         int start, int end) throws com.liferay.portal.SystemException;
219 
220     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
221         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
222         throws com.liferay.portal.SystemException;
223 
224     public int getRolesSize(long pk) throws com.liferay.portal.SystemException;
225 
226     public boolean containsRole(long pk, long rolePK)
227         throws com.liferay.portal.SystemException;
228 
229     public boolean containsRoles(long pk)
230         throws com.liferay.portal.SystemException;
231 
232     public void addRole(long pk, long rolePK)
233         throws com.liferay.portal.SystemException;
234 
235     public void addRole(long pk, com.liferay.portal.model.Role role)
236         throws com.liferay.portal.SystemException;
237 
238     public void addRoles(long pk, long[] rolePKs)
239         throws com.liferay.portal.SystemException;
240 
241     public void addRoles(long pk,
242         java.util.List<com.liferay.portal.model.Role> roles)
243         throws com.liferay.portal.SystemException;
244 
245     public void clearRoles(long pk) throws com.liferay.portal.SystemException;
246 
247     public void removeRole(long pk, long rolePK)
248         throws com.liferay.portal.SystemException;
249 
250     public void removeRole(long pk, com.liferay.portal.model.Role role)
251         throws com.liferay.portal.SystemException;
252 
253     public void removeRoles(long pk, long[] rolePKs)
254         throws com.liferay.portal.SystemException;
255 
256     public void removeRoles(long pk,
257         java.util.List<com.liferay.portal.model.Role> roles)
258         throws com.liferay.portal.SystemException;
259 
260     public void setRoles(long pk, long[] rolePKs)
261         throws com.liferay.portal.SystemException;
262 
263     public void setRoles(long pk,
264         java.util.List<com.liferay.portal.model.Role> roles)
265         throws com.liferay.portal.SystemException;
266 
267     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
268         throws com.liferay.portal.SystemException;
269 
270     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
271         int start, int end) throws com.liferay.portal.SystemException;
272 
273     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
274         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
275         throws com.liferay.portal.SystemException;
276 
277     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
278 
279     public boolean containsUser(long pk, long userPK)
280         throws com.liferay.portal.SystemException;
281 
282     public boolean containsUsers(long pk)
283         throws com.liferay.portal.SystemException;
284 
285     public void addUser(long pk, long userPK)
286         throws com.liferay.portal.SystemException;
287 
288     public void addUser(long pk, com.liferay.portal.model.User user)
289         throws com.liferay.portal.SystemException;
290 
291     public void addUsers(long pk, long[] userPKs)
292         throws com.liferay.portal.SystemException;
293 
294     public void addUsers(long pk,
295         java.util.List<com.liferay.portal.model.User> users)
296         throws com.liferay.portal.SystemException;
297 
298     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
299 
300     public void removeUser(long pk, long userPK)
301         throws com.liferay.portal.SystemException;
302 
303     public void removeUser(long pk, com.liferay.portal.model.User user)
304         throws com.liferay.portal.SystemException;
305 
306     public void removeUsers(long pk, long[] userPKs)
307         throws com.liferay.portal.SystemException;
308 
309     public void removeUsers(long pk,
310         java.util.List<com.liferay.portal.model.User> users)
311         throws com.liferay.portal.SystemException;
312 
313     public void setUsers(long pk, long[] userPKs)
314         throws com.liferay.portal.SystemException;
315 
316     public void setUsers(long pk,
317         java.util.List<com.liferay.portal.model.User> users)
318         throws com.liferay.portal.SystemException;
319 }