1   /**
2    * Copyright (c) 2000-2008 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="UserGroupRolePersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface UserGroupRolePersistence {
32      public com.liferay.portal.model.UserGroupRole create(
33          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK);
34  
35      public com.liferay.portal.model.UserGroupRole remove(
36          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
37          throws com.liferay.portal.NoSuchUserGroupRoleException,
38              com.liferay.portal.SystemException;
39  
40      public com.liferay.portal.model.UserGroupRole remove(
41          com.liferay.portal.model.UserGroupRole userGroupRole)
42          throws com.liferay.portal.SystemException;
43  
44      /**
45       * @deprecated Use <code>update(UserGroupRole userGroupRole, boolean merge)</code>.
46       */
47      public com.liferay.portal.model.UserGroupRole update(
48          com.liferay.portal.model.UserGroupRole userGroupRole)
49          throws com.liferay.portal.SystemException;
50  
51      /**
52       * Add, update, or merge, the entity. This method also calls the model
53       * listeners to trigger the proper events associated with adding, deleting,
54       * or updating an entity.
55       *
56       * @param        userGroupRole the entity to add, update, or merge
57       * @param        merge boolean value for whether to merge the entity. The
58       *                default value is false. Setting merge to true is more
59       *                expensive and should only be true when userGroupRole is
60       *                transient. See LEP-5473 for a detailed discussion of this
61       *                method.
62       * @return        true if the portlet can be displayed via Ajax
63       */
64      public com.liferay.portal.model.UserGroupRole update(
65          com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
66          throws com.liferay.portal.SystemException;
67  
68      public com.liferay.portal.model.UserGroupRole updateImpl(
69          com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
70          throws com.liferay.portal.SystemException;
71  
72      public com.liferay.portal.model.UserGroupRole findByPrimaryKey(
73          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
74          throws com.liferay.portal.NoSuchUserGroupRoleException,
75              com.liferay.portal.SystemException;
76  
77      public com.liferay.portal.model.UserGroupRole fetchByPrimaryKey(
78          com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
79          throws com.liferay.portal.SystemException;
80  
81      public java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
82          long userId) throws com.liferay.portal.SystemException;
83  
84      public java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
85          long userId, int start, int end)
86          throws com.liferay.portal.SystemException;
87  
88      public java.util.List<com.liferay.portal.model.UserGroupRole> findByUserId(
89          long userId, int start, int end,
90          com.liferay.portal.kernel.util.OrderByComparator obc)
91          throws com.liferay.portal.SystemException;
92  
93      public com.liferay.portal.model.UserGroupRole findByUserId_First(
94          long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
95          throws com.liferay.portal.NoSuchUserGroupRoleException,
96              com.liferay.portal.SystemException;
97  
98      public com.liferay.portal.model.UserGroupRole findByUserId_Last(
99          long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
100         throws com.liferay.portal.NoSuchUserGroupRoleException,
101             com.liferay.portal.SystemException;
102 
103     public com.liferay.portal.model.UserGroupRole[] findByUserId_PrevAndNext(
104         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
105         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.NoSuchUserGroupRoleException,
107             com.liferay.portal.SystemException;
108 
109     public java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
110         long groupId) throws com.liferay.portal.SystemException;
111 
112     public java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
113         long groupId, int start, int end)
114         throws com.liferay.portal.SystemException;
115 
116     public java.util.List<com.liferay.portal.model.UserGroupRole> findByGroupId(
117         long groupId, int start, int end,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException;
120 
121     public com.liferay.portal.model.UserGroupRole findByGroupId_First(
122         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.NoSuchUserGroupRoleException,
124             com.liferay.portal.SystemException;
125 
126     public com.liferay.portal.model.UserGroupRole findByGroupId_Last(
127         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.NoSuchUserGroupRoleException,
129             com.liferay.portal.SystemException;
130 
131     public com.liferay.portal.model.UserGroupRole[] findByGroupId_PrevAndNext(
132         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
133         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchUserGroupRoleException,
135             com.liferay.portal.SystemException;
136 
137     public java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
138         long roleId) throws com.liferay.portal.SystemException;
139 
140     public java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
141         long roleId, int start, int end)
142         throws com.liferay.portal.SystemException;
143 
144     public java.util.List<com.liferay.portal.model.UserGroupRole> findByRoleId(
145         long roleId, int start, int end,
146         com.liferay.portal.kernel.util.OrderByComparator obc)
147         throws com.liferay.portal.SystemException;
148 
149     public com.liferay.portal.model.UserGroupRole findByRoleId_First(
150         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.NoSuchUserGroupRoleException,
152             com.liferay.portal.SystemException;
153 
154     public com.liferay.portal.model.UserGroupRole findByRoleId_Last(
155         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
156         throws com.liferay.portal.NoSuchUserGroupRoleException,
157             com.liferay.portal.SystemException;
158 
159     public com.liferay.portal.model.UserGroupRole[] findByRoleId_PrevAndNext(
160         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
161         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.NoSuchUserGroupRoleException,
163             com.liferay.portal.SystemException;
164 
165     public java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
166         long userId, long groupId) throws com.liferay.portal.SystemException;
167 
168     public java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
169         long userId, long groupId, int start, int end)
170         throws com.liferay.portal.SystemException;
171 
172     public java.util.List<com.liferay.portal.model.UserGroupRole> findByU_G(
173         long userId, long groupId, int start, int end,
174         com.liferay.portal.kernel.util.OrderByComparator obc)
175         throws com.liferay.portal.SystemException;
176 
177     public com.liferay.portal.model.UserGroupRole findByU_G_First(long userId,
178         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.NoSuchUserGroupRoleException,
180             com.liferay.portal.SystemException;
181 
182     public com.liferay.portal.model.UserGroupRole findByU_G_Last(long userId,
183         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
184         throws com.liferay.portal.NoSuchUserGroupRoleException,
185             com.liferay.portal.SystemException;
186 
187     public com.liferay.portal.model.UserGroupRole[] findByU_G_PrevAndNext(
188         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
189         long userId, long groupId,
190         com.liferay.portal.kernel.util.OrderByComparator obc)
191         throws com.liferay.portal.NoSuchUserGroupRoleException,
192             com.liferay.portal.SystemException;
193 
194     public java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
195         long groupId, long roleId) throws com.liferay.portal.SystemException;
196 
197     public java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
198         long groupId, long roleId, int start, int end)
199         throws com.liferay.portal.SystemException;
200 
201     public java.util.List<com.liferay.portal.model.UserGroupRole> findByG_R(
202         long groupId, long roleId, int start, int end,
203         com.liferay.portal.kernel.util.OrderByComparator obc)
204         throws com.liferay.portal.SystemException;
205 
206     public com.liferay.portal.model.UserGroupRole findByG_R_First(
207         long groupId, long roleId,
208         com.liferay.portal.kernel.util.OrderByComparator obc)
209         throws com.liferay.portal.NoSuchUserGroupRoleException,
210             com.liferay.portal.SystemException;
211 
212     public com.liferay.portal.model.UserGroupRole findByG_R_Last(long groupId,
213         long roleId, com.liferay.portal.kernel.util.OrderByComparator obc)
214         throws com.liferay.portal.NoSuchUserGroupRoleException,
215             com.liferay.portal.SystemException;
216 
217     public com.liferay.portal.model.UserGroupRole[] findByG_R_PrevAndNext(
218         com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK,
219         long groupId, long roleId,
220         com.liferay.portal.kernel.util.OrderByComparator obc)
221         throws com.liferay.portal.NoSuchUserGroupRoleException,
222             com.liferay.portal.SystemException;
223 
224     public java.util.List<Object> findWithDynamicQuery(
225         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
226         throws com.liferay.portal.SystemException;
227 
228     public java.util.List<Object> findWithDynamicQuery(
229         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
230         int end) throws com.liferay.portal.SystemException;
231 
232     public java.util.List<com.liferay.portal.model.UserGroupRole> findAll()
233         throws com.liferay.portal.SystemException;
234 
235     public java.util.List<com.liferay.portal.model.UserGroupRole> findAll(
236         int start, int end) throws com.liferay.portal.SystemException;
237 
238     public java.util.List<com.liferay.portal.model.UserGroupRole> findAll(
239         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
240         throws com.liferay.portal.SystemException;
241 
242     public void removeByUserId(long userId)
243         throws com.liferay.portal.SystemException;
244 
245     public void removeByGroupId(long groupId)
246         throws com.liferay.portal.SystemException;
247 
248     public void removeByRoleId(long roleId)
249         throws com.liferay.portal.SystemException;
250 
251     public void removeByU_G(long userId, long groupId)
252         throws com.liferay.portal.SystemException;
253 
254     public void removeByG_R(long groupId, long roleId)
255         throws com.liferay.portal.SystemException;
256 
257     public void removeAll() throws com.liferay.portal.SystemException;
258 
259     public int countByUserId(long userId)
260         throws com.liferay.portal.SystemException;
261 
262     public int countByGroupId(long groupId)
263         throws com.liferay.portal.SystemException;
264 
265     public int countByRoleId(long roleId)
266         throws com.liferay.portal.SystemException;
267 
268     public int countByU_G(long userId, long groupId)
269         throws com.liferay.portal.SystemException;
270 
271     public int countByG_R(long groupId, long roleId)
272         throws com.liferay.portal.SystemException;
273 
274     public int countAll() throws com.liferay.portal.SystemException;
275 
276     public void registerListener(
277         com.liferay.portal.model.ModelListener listener);
278 
279     public void unregisterListener(
280         com.liferay.portal.model.ModelListener listener);
281 }