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="GroupPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface GroupPersistence {
32      public com.liferay.portal.model.Group create(long groupId);
33  
34      public com.liferay.portal.model.Group remove(long groupId)
35          throws com.liferay.portal.NoSuchGroupException,
36              com.liferay.portal.SystemException;
37  
38      public com.liferay.portal.model.Group remove(
39          com.liferay.portal.model.Group group)
40          throws com.liferay.portal.SystemException;
41  
42      /**
43       * @deprecated Use <code>update(Group group, boolean merge)</code>.
44       */
45      public com.liferay.portal.model.Group update(
46          com.liferay.portal.model.Group group)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * Add, update, or merge, the entity. This method also calls the model
51       * listeners to trigger the proper events associated with adding, deleting,
52       * or updating an entity.
53       *
54       * @param        group the entity to add, update, or merge
55       * @param        merge boolean value for whether to merge the entity. The
56       *                default value is false. Setting merge to true is more
57       *                expensive and should only be true when group is
58       *                transient. See LEP-5473 for a detailed discussion of this
59       *                method.
60       * @return        true if the portlet can be displayed via Ajax
61       */
62      public com.liferay.portal.model.Group update(
63          com.liferay.portal.model.Group group, boolean merge)
64          throws com.liferay.portal.SystemException;
65  
66      public com.liferay.portal.model.Group updateImpl(
67          com.liferay.portal.model.Group group, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Group findByPrimaryKey(long groupId)
71          throws com.liferay.portal.NoSuchGroupException,
72              com.liferay.portal.SystemException;
73  
74      public com.liferay.portal.model.Group fetchByPrimaryKey(long groupId)
75          throws com.liferay.portal.SystemException;
76  
77      public com.liferay.portal.model.Group findByLiveGroupId(long liveGroupId)
78          throws com.liferay.portal.NoSuchGroupException,
79              com.liferay.portal.SystemException;
80  
81      public com.liferay.portal.model.Group fetchByLiveGroupId(long liveGroupId)
82          throws com.liferay.portal.SystemException;
83  
84      public com.liferay.portal.model.Group findByC_N(long companyId,
85          java.lang.String name)
86          throws com.liferay.portal.NoSuchGroupException,
87              com.liferay.portal.SystemException;
88  
89      public com.liferay.portal.model.Group fetchByC_N(long companyId,
90          java.lang.String name) throws com.liferay.portal.SystemException;
91  
92      public com.liferay.portal.model.Group findByC_F(long companyId,
93          java.lang.String friendlyURL)
94          throws com.liferay.portal.NoSuchGroupException,
95              com.liferay.portal.SystemException;
96  
97      public com.liferay.portal.model.Group fetchByC_F(long companyId,
98          java.lang.String friendlyURL) throws com.liferay.portal.SystemException;
99  
100     public com.liferay.portal.model.Group findByC_C_C(long companyId,
101         long classNameId, long classPK)
102         throws com.liferay.portal.NoSuchGroupException,
103             com.liferay.portal.SystemException;
104 
105     public com.liferay.portal.model.Group fetchByC_C_C(long companyId,
106         long classNameId, long classPK)
107         throws com.liferay.portal.SystemException;
108 
109     public java.util.List<Object> findWithDynamicQuery(
110         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
111         throws com.liferay.portal.SystemException;
112 
113     public java.util.List<Object> findWithDynamicQuery(
114         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
115         int end) throws com.liferay.portal.SystemException;
116 
117     public java.util.List<com.liferay.portal.model.Group> findAll()
118         throws com.liferay.portal.SystemException;
119 
120     public java.util.List<com.liferay.portal.model.Group> findAll(int start,
121         int end) throws com.liferay.portal.SystemException;
122 
123     public java.util.List<com.liferay.portal.model.Group> findAll(int start,
124         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException;
126 
127     public void removeByLiveGroupId(long liveGroupId)
128         throws com.liferay.portal.NoSuchGroupException,
129             com.liferay.portal.SystemException;
130 
131     public void removeByC_N(long companyId, java.lang.String name)
132         throws com.liferay.portal.NoSuchGroupException,
133             com.liferay.portal.SystemException;
134 
135     public void removeByC_F(long companyId, java.lang.String friendlyURL)
136         throws com.liferay.portal.NoSuchGroupException,
137             com.liferay.portal.SystemException;
138 
139     public void removeByC_C_C(long companyId, long classNameId, long classPK)
140         throws com.liferay.portal.NoSuchGroupException,
141             com.liferay.portal.SystemException;
142 
143     public void removeAll() throws com.liferay.portal.SystemException;
144 
145     public int countByLiveGroupId(long liveGroupId)
146         throws com.liferay.portal.SystemException;
147 
148     public int countByC_N(long companyId, java.lang.String name)
149         throws com.liferay.portal.SystemException;
150 
151     public int countByC_F(long companyId, java.lang.String friendlyURL)
152         throws com.liferay.portal.SystemException;
153 
154     public int countByC_C_C(long companyId, long classNameId, long classPK)
155         throws com.liferay.portal.SystemException;
156 
157     public int countAll() throws com.liferay.portal.SystemException;
158 
159     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
160         long pk) throws com.liferay.portal.SystemException;
161 
162     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
163         long pk, int start, int end) throws com.liferay.portal.SystemException;
164 
165     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
166         long pk, int start, int end,
167         com.liferay.portal.kernel.util.OrderByComparator obc)
168         throws com.liferay.portal.SystemException;
169 
170     public int getOrganizationsSize(long pk)
171         throws com.liferay.portal.SystemException;
172 
173     public boolean containsOrganization(long pk, long organizationPK)
174         throws com.liferay.portal.SystemException;
175 
176     public boolean containsOrganizations(long pk)
177         throws com.liferay.portal.SystemException;
178 
179     public void addOrganization(long pk, long organizationPK)
180         throws com.liferay.portal.SystemException;
181 
182     public void addOrganization(long pk,
183         com.liferay.portal.model.Organization organization)
184         throws com.liferay.portal.SystemException;
185 
186     public void addOrganizations(long pk, long[] organizationPKs)
187         throws com.liferay.portal.SystemException;
188 
189     public void addOrganizations(long pk,
190         java.util.List<com.liferay.portal.model.Organization> organizations)
191         throws com.liferay.portal.SystemException;
192 
193     public void clearOrganizations(long pk)
194         throws com.liferay.portal.SystemException;
195 
196     public void removeOrganization(long pk, long organizationPK)
197         throws com.liferay.portal.SystemException;
198 
199     public void removeOrganization(long pk,
200         com.liferay.portal.model.Organization organization)
201         throws com.liferay.portal.SystemException;
202 
203     public void removeOrganizations(long pk, long[] organizationPKs)
204         throws com.liferay.portal.SystemException;
205 
206     public void removeOrganizations(long pk,
207         java.util.List<com.liferay.portal.model.Organization> organizations)
208         throws com.liferay.portal.SystemException;
209 
210     public void setOrganizations(long pk, long[] organizationPKs)
211         throws com.liferay.portal.SystemException;
212 
213     public void setOrganizations(long pk,
214         java.util.List<com.liferay.portal.model.Organization> organizations)
215         throws com.liferay.portal.SystemException;
216 
217     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
218         long pk) throws com.liferay.portal.SystemException;
219 
220     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
221         long pk, int start, int end) throws com.liferay.portal.SystemException;
222 
223     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
224         long pk, int start, int end,
225         com.liferay.portal.kernel.util.OrderByComparator obc)
226         throws com.liferay.portal.SystemException;
227 
228     public int getPermissionsSize(long pk)
229         throws com.liferay.portal.SystemException;
230 
231     public boolean containsPermission(long pk, long permissionPK)
232         throws com.liferay.portal.SystemException;
233 
234     public boolean containsPermissions(long pk)
235         throws com.liferay.portal.SystemException;
236 
237     public void addPermission(long pk, long permissionPK)
238         throws com.liferay.portal.SystemException;
239 
240     public void addPermission(long pk,
241         com.liferay.portal.model.Permission permission)
242         throws com.liferay.portal.SystemException;
243 
244     public void addPermissions(long pk, long[] permissionPKs)
245         throws com.liferay.portal.SystemException;
246 
247     public void addPermissions(long pk,
248         java.util.List<com.liferay.portal.model.Permission> permissions)
249         throws com.liferay.portal.SystemException;
250 
251     public void clearPermissions(long pk)
252         throws com.liferay.portal.SystemException;
253 
254     public void removePermission(long pk, long permissionPK)
255         throws com.liferay.portal.SystemException;
256 
257     public void removePermission(long pk,
258         com.liferay.portal.model.Permission permission)
259         throws com.liferay.portal.SystemException;
260 
261     public void removePermissions(long pk, long[] permissionPKs)
262         throws com.liferay.portal.SystemException;
263 
264     public void removePermissions(long pk,
265         java.util.List<com.liferay.portal.model.Permission> permissions)
266         throws com.liferay.portal.SystemException;
267 
268     public void setPermissions(long pk, long[] permissionPKs)
269         throws com.liferay.portal.SystemException;
270 
271     public void setPermissions(long pk,
272         java.util.List<com.liferay.portal.model.Permission> permissions)
273         throws com.liferay.portal.SystemException;
274 
275     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk)
276         throws com.liferay.portal.SystemException;
277 
278     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
279         int start, int end) throws com.liferay.portal.SystemException;
280 
281     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
282         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
283         throws com.liferay.portal.SystemException;
284 
285     public int getRolesSize(long pk) throws com.liferay.portal.SystemException;
286 
287     public boolean containsRole(long pk, long rolePK)
288         throws com.liferay.portal.SystemException;
289 
290     public boolean containsRoles(long pk)
291         throws com.liferay.portal.SystemException;
292 
293     public void addRole(long pk, long rolePK)
294         throws com.liferay.portal.SystemException;
295 
296     public void addRole(long pk, com.liferay.portal.model.Role role)
297         throws com.liferay.portal.SystemException;
298 
299     public void addRoles(long pk, long[] rolePKs)
300         throws com.liferay.portal.SystemException;
301 
302     public void addRoles(long pk,
303         java.util.List<com.liferay.portal.model.Role> roles)
304         throws com.liferay.portal.SystemException;
305 
306     public void clearRoles(long pk) throws com.liferay.portal.SystemException;
307 
308     public void removeRole(long pk, long rolePK)
309         throws com.liferay.portal.SystemException;
310 
311     public void removeRole(long pk, com.liferay.portal.model.Role role)
312         throws com.liferay.portal.SystemException;
313 
314     public void removeRoles(long pk, long[] rolePKs)
315         throws com.liferay.portal.SystemException;
316 
317     public void removeRoles(long pk,
318         java.util.List<com.liferay.portal.model.Role> roles)
319         throws com.liferay.portal.SystemException;
320 
321     public void setRoles(long pk, long[] rolePKs)
322         throws com.liferay.portal.SystemException;
323 
324     public void setRoles(long pk,
325         java.util.List<com.liferay.portal.model.Role> roles)
326         throws com.liferay.portal.SystemException;
327 
328     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
329         long pk) throws com.liferay.portal.SystemException;
330 
331     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
332         long pk, int start, int end) throws com.liferay.portal.SystemException;
333 
334     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
335         long pk, int start, int end,
336         com.liferay.portal.kernel.util.OrderByComparator obc)
337         throws com.liferay.portal.SystemException;
338 
339     public int getUserGroupsSize(long pk)
340         throws com.liferay.portal.SystemException;
341 
342     public boolean containsUserGroup(long pk, long userGroupPK)
343         throws com.liferay.portal.SystemException;
344 
345     public boolean containsUserGroups(long pk)
346         throws com.liferay.portal.SystemException;
347 
348     public void addUserGroup(long pk, long userGroupPK)
349         throws com.liferay.portal.SystemException;
350 
351     public void addUserGroup(long pk,
352         com.liferay.portal.model.UserGroup userGroup)
353         throws com.liferay.portal.SystemException;
354 
355     public void addUserGroups(long pk, long[] userGroupPKs)
356         throws com.liferay.portal.SystemException;
357 
358     public void addUserGroups(long pk,
359         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
360         throws com.liferay.portal.SystemException;
361 
362     public void clearUserGroups(long pk)
363         throws com.liferay.portal.SystemException;
364 
365     public void removeUserGroup(long pk, long userGroupPK)
366         throws com.liferay.portal.SystemException;
367 
368     public void removeUserGroup(long pk,
369         com.liferay.portal.model.UserGroup userGroup)
370         throws com.liferay.portal.SystemException;
371 
372     public void removeUserGroups(long pk, long[] userGroupPKs)
373         throws com.liferay.portal.SystemException;
374 
375     public void removeUserGroups(long pk,
376         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
377         throws com.liferay.portal.SystemException;
378 
379     public void setUserGroups(long pk, long[] userGroupPKs)
380         throws com.liferay.portal.SystemException;
381 
382     public void setUserGroups(long pk,
383         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
384         throws com.liferay.portal.SystemException;
385 
386     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
387         throws com.liferay.portal.SystemException;
388 
389     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
390         int start, int end) throws com.liferay.portal.SystemException;
391 
392     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
393         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
394         throws com.liferay.portal.SystemException;
395 
396     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
397 
398     public boolean containsUser(long pk, long userPK)
399         throws com.liferay.portal.SystemException;
400 
401     public boolean containsUsers(long pk)
402         throws com.liferay.portal.SystemException;
403 
404     public void addUser(long pk, long userPK)
405         throws com.liferay.portal.SystemException;
406 
407     public void addUser(long pk, com.liferay.portal.model.User user)
408         throws com.liferay.portal.SystemException;
409 
410     public void addUsers(long pk, long[] userPKs)
411         throws com.liferay.portal.SystemException;
412 
413     public void addUsers(long pk,
414         java.util.List<com.liferay.portal.model.User> users)
415         throws com.liferay.portal.SystemException;
416 
417     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
418 
419     public void removeUser(long pk, long userPK)
420         throws com.liferay.portal.SystemException;
421 
422     public void removeUser(long pk, com.liferay.portal.model.User user)
423         throws com.liferay.portal.SystemException;
424 
425     public void removeUsers(long pk, long[] userPKs)
426         throws com.liferay.portal.SystemException;
427 
428     public void removeUsers(long pk,
429         java.util.List<com.liferay.portal.model.User> users)
430         throws com.liferay.portal.SystemException;
431 
432     public void setUsers(long pk, long[] userPKs)
433         throws com.liferay.portal.SystemException;
434 
435     public void setUsers(long pk,
436         java.util.List<com.liferay.portal.model.User> users)
437         throws com.liferay.portal.SystemException;
438 
439     public void registerListener(
440         com.liferay.portal.model.ModelListener listener);
441 
442     public void unregisterListener(
443         com.liferay.portal.model.ModelListener listener);
444 }