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="RolePersistence.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 RolePersistence extends BasePersistence {
36      public com.liferay.portal.model.Role create(long roleId);
37  
38      public com.liferay.portal.model.Role remove(long roleId)
39          throws com.liferay.portal.NoSuchRoleException,
40              com.liferay.portal.SystemException;
41  
42      public com.liferay.portal.model.Role remove(
43          com.liferay.portal.model.Role role)
44          throws com.liferay.portal.SystemException;
45  
46      /**
47       * @deprecated Use <code>update(Role role, boolean merge)</code>.
48       */
49      public com.liferay.portal.model.Role update(
50          com.liferay.portal.model.Role role)
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        role 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 role 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.Role update(
67          com.liferay.portal.model.Role role, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Role updateImpl(
71          com.liferay.portal.model.Role role, boolean merge)
72          throws com.liferay.portal.SystemException;
73  
74      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
75      public com.liferay.portal.model.Role findByPrimaryKey(long roleId)
76          throws com.liferay.portal.NoSuchRoleException,
77              com.liferay.portal.SystemException;
78  
79      public com.liferay.portal.model.Role fetchByPrimaryKey(long roleId)
80          throws com.liferay.portal.SystemException;
81  
82      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
83      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
84          long companyId) throws com.liferay.portal.SystemException;
85  
86      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
87      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
88          long companyId, int start, int end)
89          throws com.liferay.portal.SystemException;
90  
91      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
92      public java.util.List<com.liferay.portal.model.Role> findByCompanyId(
93          long companyId, int start, int end,
94          com.liferay.portal.kernel.util.OrderByComparator obc)
95          throws com.liferay.portal.SystemException;
96  
97      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
98      public com.liferay.portal.model.Role findByCompanyId_First(long companyId,
99          com.liferay.portal.kernel.util.OrderByComparator obc)
100         throws com.liferay.portal.NoSuchRoleException,
101             com.liferay.portal.SystemException;
102 
103     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
104     public com.liferay.portal.model.Role findByCompanyId_Last(long companyId,
105         com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.NoSuchRoleException,
107             com.liferay.portal.SystemException;
108 
109     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
110     public com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext(
111         long roleId, long companyId,
112         com.liferay.portal.kernel.util.OrderByComparator obc)
113         throws com.liferay.portal.NoSuchRoleException,
114             com.liferay.portal.SystemException;
115 
116     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
117     public com.liferay.portal.model.Role findByC_N(long companyId,
118         java.lang.String name)
119         throws com.liferay.portal.NoSuchRoleException,
120             com.liferay.portal.SystemException;
121 
122     public com.liferay.portal.model.Role fetchByC_N(long companyId,
123         java.lang.String name) throws com.liferay.portal.SystemException;
124 
125     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
126     public com.liferay.portal.model.Role findByC_C_C(long companyId,
127         long classNameId, long classPK)
128         throws com.liferay.portal.NoSuchRoleException,
129             com.liferay.portal.SystemException;
130 
131     public com.liferay.portal.model.Role fetchByC_C_C(long companyId,
132         long classNameId, long classPK)
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)
138         throws com.liferay.portal.SystemException;
139 
140     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
141     public java.util.List<Object> findWithDynamicQuery(
142         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143         int end) throws com.liferay.portal.SystemException;
144 
145     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
146     public java.util.List<com.liferay.portal.model.Role> findAll()
147         throws com.liferay.portal.SystemException;
148 
149     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
150     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
151         int end) throws com.liferay.portal.SystemException;
152 
153     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
154     public java.util.List<com.liferay.portal.model.Role> findAll(int start,
155         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
156         throws com.liferay.portal.SystemException;
157 
158     public void removeByCompanyId(long companyId)
159         throws com.liferay.portal.SystemException;
160 
161     public void removeByC_N(long companyId, java.lang.String name)
162         throws com.liferay.portal.NoSuchRoleException,
163             com.liferay.portal.SystemException;
164 
165     public void removeByC_C_C(long companyId, long classNameId, long classPK)
166         throws com.liferay.portal.NoSuchRoleException,
167             com.liferay.portal.SystemException;
168 
169     public void removeAll() throws com.liferay.portal.SystemException;
170 
171     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
172     public int countByCompanyId(long companyId)
173         throws com.liferay.portal.SystemException;
174 
175     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176     public int countByC_N(long companyId, java.lang.String name)
177         throws com.liferay.portal.SystemException;
178 
179     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
180     public int countByC_C_C(long companyId, long classNameId, long classPK)
181         throws com.liferay.portal.SystemException;
182 
183     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184     public int countAll() throws com.liferay.portal.SystemException;
185 
186     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
187     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
188         throws com.liferay.portal.SystemException;
189 
190     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
192         int start, int end) throws com.liferay.portal.SystemException;
193 
194     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
195     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
196         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
197         throws com.liferay.portal.SystemException;
198 
199     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
201 
202     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
203     public boolean containsGroup(long pk, long groupPK)
204         throws com.liferay.portal.SystemException;
205 
206     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207     public boolean containsGroups(long pk)
208         throws com.liferay.portal.SystemException;
209 
210     public void addGroup(long pk, long groupPK)
211         throws com.liferay.portal.SystemException;
212 
213     public void addGroup(long pk, com.liferay.portal.model.Group group)
214         throws com.liferay.portal.SystemException;
215 
216     public void addGroups(long pk, long[] groupPKs)
217         throws com.liferay.portal.SystemException;
218 
219     public void addGroups(long pk,
220         java.util.List<com.liferay.portal.model.Group> groups)
221         throws com.liferay.portal.SystemException;
222 
223     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
224 
225     public void removeGroup(long pk, long groupPK)
226         throws com.liferay.portal.SystemException;
227 
228     public void removeGroup(long pk, com.liferay.portal.model.Group group)
229         throws com.liferay.portal.SystemException;
230 
231     public void removeGroups(long pk, long[] groupPKs)
232         throws com.liferay.portal.SystemException;
233 
234     public void removeGroups(long pk,
235         java.util.List<com.liferay.portal.model.Group> groups)
236         throws com.liferay.portal.SystemException;
237 
238     public void setGroups(long pk, long[] groupPKs)
239         throws com.liferay.portal.SystemException;
240 
241     public void setGroups(long pk,
242         java.util.List<com.liferay.portal.model.Group> groups)
243         throws com.liferay.portal.SystemException;
244 
245     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
247         long pk) throws com.liferay.portal.SystemException;
248 
249     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
251         long pk, int start, int end) throws com.liferay.portal.SystemException;
252 
253     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
255         long pk, int start, int end,
256         com.liferay.portal.kernel.util.OrderByComparator obc)
257         throws com.liferay.portal.SystemException;
258 
259     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
260     public int getPermissionsSize(long pk)
261         throws com.liferay.portal.SystemException;
262 
263     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
264     public boolean containsPermission(long pk, long permissionPK)
265         throws com.liferay.portal.SystemException;
266 
267     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268     public boolean containsPermissions(long pk)
269         throws com.liferay.portal.SystemException;
270 
271     public void addPermission(long pk, long permissionPK)
272         throws com.liferay.portal.SystemException;
273 
274     public void addPermission(long pk,
275         com.liferay.portal.model.Permission permission)
276         throws com.liferay.portal.SystemException;
277 
278     public void addPermissions(long pk, long[] permissionPKs)
279         throws com.liferay.portal.SystemException;
280 
281     public void addPermissions(long pk,
282         java.util.List<com.liferay.portal.model.Permission> permissions)
283         throws com.liferay.portal.SystemException;
284 
285     public void clearPermissions(long pk)
286         throws com.liferay.portal.SystemException;
287 
288     public void removePermission(long pk, long permissionPK)
289         throws com.liferay.portal.SystemException;
290 
291     public void removePermission(long pk,
292         com.liferay.portal.model.Permission permission)
293         throws com.liferay.portal.SystemException;
294 
295     public void removePermissions(long pk, long[] permissionPKs)
296         throws com.liferay.portal.SystemException;
297 
298     public void removePermissions(long pk,
299         java.util.List<com.liferay.portal.model.Permission> permissions)
300         throws com.liferay.portal.SystemException;
301 
302     public void setPermissions(long pk, long[] permissionPKs)
303         throws com.liferay.portal.SystemException;
304 
305     public void setPermissions(long pk,
306         java.util.List<com.liferay.portal.model.Permission> permissions)
307         throws com.liferay.portal.SystemException;
308 
309     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
310     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
311         throws com.liferay.portal.SystemException;
312 
313     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
315         int start, int end) throws com.liferay.portal.SystemException;
316 
317     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
318     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
319         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
320         throws com.liferay.portal.SystemException;
321 
322     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
324 
325     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326     public boolean containsUser(long pk, long userPK)
327         throws com.liferay.portal.SystemException;
328 
329     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330     public boolean containsUsers(long pk)
331         throws com.liferay.portal.SystemException;
332 
333     public void addUser(long pk, long userPK)
334         throws com.liferay.portal.SystemException;
335 
336     public void addUser(long pk, com.liferay.portal.model.User user)
337         throws com.liferay.portal.SystemException;
338 
339     public void addUsers(long pk, long[] userPKs)
340         throws com.liferay.portal.SystemException;
341 
342     public void addUsers(long pk,
343         java.util.List<com.liferay.portal.model.User> users)
344         throws com.liferay.portal.SystemException;
345 
346     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
347 
348     public void removeUser(long pk, long userPK)
349         throws com.liferay.portal.SystemException;
350 
351     public void removeUser(long pk, com.liferay.portal.model.User user)
352         throws com.liferay.portal.SystemException;
353 
354     public void removeUsers(long pk, long[] userPKs)
355         throws com.liferay.portal.SystemException;
356 
357     public void removeUsers(long pk,
358         java.util.List<com.liferay.portal.model.User> users)
359         throws com.liferay.portal.SystemException;
360 
361     public void setUsers(long pk, long[] userPKs)
362         throws com.liferay.portal.SystemException;
363 
364     public void setUsers(long pk,
365         java.util.List<com.liferay.portal.model.User> users)
366         throws com.liferay.portal.SystemException;
367 }