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.SystemException,
36              com.liferay.portal.NoSuchGroupException;
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.SystemException,
72              com.liferay.portal.NoSuchGroupException;
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.SystemException,
79              com.liferay.portal.NoSuchGroupException;
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.SystemException,
87              com.liferay.portal.NoSuchGroupException;
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.SystemException,
95              com.liferay.portal.NoSuchGroupException;
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.SystemException,
103             com.liferay.portal.NoSuchGroupException;
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<com.liferay.portal.model.Group> findWithDynamicQuery(
110         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
111         throws com.liferay.portal.SystemException;
112 
113     public java.util.List<com.liferay.portal.model.Group> findWithDynamicQuery(
114         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
115         int begin, 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 begin,
121         int end) throws com.liferay.portal.SystemException;
122 
123     public java.util.List<com.liferay.portal.model.Group> findAll(int begin,
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.SystemException,
129             com.liferay.portal.NoSuchGroupException;
130 
131     public void removeByC_N(long companyId, java.lang.String name)
132         throws com.liferay.portal.SystemException,
133             com.liferay.portal.NoSuchGroupException;
134 
135     public void removeByC_F(long companyId, java.lang.String friendlyURL)
136         throws com.liferay.portal.SystemException,
137             com.liferay.portal.NoSuchGroupException;
138 
139     public void removeByC_C_C(long companyId, long classNameId, long classPK)
140         throws com.liferay.portal.SystemException,
141             com.liferay.portal.NoSuchGroupException;
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)
161         throws com.liferay.portal.SystemException,
162             com.liferay.portal.NoSuchGroupException;
163 
164     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
165         long pk, int begin, int end)
166         throws com.liferay.portal.SystemException,
167             com.liferay.portal.NoSuchGroupException;
168 
169     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
170         long pk, int begin, int end,
171         com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portal.NoSuchGroupException;
174 
175     public int getOrganizationsSize(long pk)
176         throws com.liferay.portal.SystemException;
177 
178     public boolean containsOrganization(long pk, long organizationPK)
179         throws com.liferay.portal.SystemException;
180 
181     public boolean containsOrganizations(long pk)
182         throws com.liferay.portal.SystemException;
183 
184     public void addOrganization(long pk, long organizationPK)
185         throws com.liferay.portal.SystemException,
186             com.liferay.portal.NoSuchGroupException,
187             com.liferay.portal.NoSuchOrganizationException;
188 
189     public void addOrganization(long pk,
190         com.liferay.portal.model.Organization organization)
191         throws com.liferay.portal.SystemException,
192             com.liferay.portal.NoSuchGroupException,
193             com.liferay.portal.NoSuchOrganizationException;
194 
195     public void addOrganizations(long pk, long[] organizationPKs)
196         throws com.liferay.portal.SystemException,
197             com.liferay.portal.NoSuchGroupException,
198             com.liferay.portal.NoSuchOrganizationException;
199 
200     public void addOrganizations(long pk,
201         java.util.List<com.liferay.portal.model.Organization> organizations)
202         throws com.liferay.portal.SystemException,
203             com.liferay.portal.NoSuchGroupException,
204             com.liferay.portal.NoSuchOrganizationException;
205 
206     public void clearOrganizations(long pk)
207         throws com.liferay.portal.SystemException,
208             com.liferay.portal.NoSuchGroupException;
209 
210     public void removeOrganization(long pk, long organizationPK)
211         throws com.liferay.portal.SystemException,
212             com.liferay.portal.NoSuchGroupException,
213             com.liferay.portal.NoSuchOrganizationException;
214 
215     public void removeOrganization(long pk,
216         com.liferay.portal.model.Organization organization)
217         throws com.liferay.portal.SystemException,
218             com.liferay.portal.NoSuchGroupException,
219             com.liferay.portal.NoSuchOrganizationException;
220 
221     public void removeOrganizations(long pk, long[] organizationPKs)
222         throws com.liferay.portal.SystemException,
223             com.liferay.portal.NoSuchGroupException,
224             com.liferay.portal.NoSuchOrganizationException;
225 
226     public void removeOrganizations(long pk,
227         java.util.List<com.liferay.portal.model.Organization> organizations)
228         throws com.liferay.portal.SystemException,
229             com.liferay.portal.NoSuchGroupException,
230             com.liferay.portal.NoSuchOrganizationException;
231 
232     public void setOrganizations(long pk, long[] organizationPKs)
233         throws com.liferay.portal.SystemException,
234             com.liferay.portal.NoSuchGroupException,
235             com.liferay.portal.NoSuchOrganizationException;
236 
237     public void setOrganizations(long pk,
238         java.util.List<com.liferay.portal.model.Organization> organizations)
239         throws com.liferay.portal.SystemException,
240             com.liferay.portal.NoSuchGroupException,
241             com.liferay.portal.NoSuchOrganizationException;
242 
243     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
244         long pk)
245         throws com.liferay.portal.SystemException,
246             com.liferay.portal.NoSuchGroupException;
247 
248     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
249         long pk, int begin, int end)
250         throws com.liferay.portal.SystemException,
251             com.liferay.portal.NoSuchGroupException;
252 
253     public java.util.List<com.liferay.portal.model.Permission> getPermissions(
254         long pk, int begin, int end,
255         com.liferay.portal.kernel.util.OrderByComparator obc)
256         throws com.liferay.portal.SystemException,
257             com.liferay.portal.NoSuchGroupException;
258 
259     public int getPermissionsSize(long pk)
260         throws com.liferay.portal.SystemException;
261 
262     public boolean containsPermission(long pk, long permissionPK)
263         throws com.liferay.portal.SystemException;
264 
265     public boolean containsPermissions(long pk)
266         throws com.liferay.portal.SystemException;
267 
268     public void addPermission(long pk, long permissionPK)
269         throws com.liferay.portal.SystemException,
270             com.liferay.portal.NoSuchPermissionException,
271             com.liferay.portal.NoSuchGroupException;
272 
273     public void addPermission(long pk,
274         com.liferay.portal.model.Permission permission)
275         throws com.liferay.portal.SystemException,
276             com.liferay.portal.NoSuchPermissionException,
277             com.liferay.portal.NoSuchGroupException;
278 
279     public void addPermissions(long pk, long[] permissionPKs)
280         throws com.liferay.portal.SystemException,
281             com.liferay.portal.NoSuchPermissionException,
282             com.liferay.portal.NoSuchGroupException;
283 
284     public void addPermissions(long pk,
285         java.util.List<com.liferay.portal.model.Permission> permissions)
286         throws com.liferay.portal.SystemException,
287             com.liferay.portal.NoSuchPermissionException,
288             com.liferay.portal.NoSuchGroupException;
289 
290     public void clearPermissions(long pk)
291         throws com.liferay.portal.SystemException,
292             com.liferay.portal.NoSuchGroupException;
293 
294     public void removePermission(long pk, long permissionPK)
295         throws com.liferay.portal.SystemException,
296             com.liferay.portal.NoSuchPermissionException,
297             com.liferay.portal.NoSuchGroupException;
298 
299     public void removePermission(long pk,
300         com.liferay.portal.model.Permission permission)
301         throws com.liferay.portal.SystemException,
302             com.liferay.portal.NoSuchPermissionException,
303             com.liferay.portal.NoSuchGroupException;
304 
305     public void removePermissions(long pk, long[] permissionPKs)
306         throws com.liferay.portal.SystemException,
307             com.liferay.portal.NoSuchPermissionException,
308             com.liferay.portal.NoSuchGroupException;
309 
310     public void removePermissions(long pk,
311         java.util.List<com.liferay.portal.model.Permission> permissions)
312         throws com.liferay.portal.SystemException,
313             com.liferay.portal.NoSuchPermissionException,
314             com.liferay.portal.NoSuchGroupException;
315 
316     public void setPermissions(long pk, long[] permissionPKs)
317         throws com.liferay.portal.SystemException,
318             com.liferay.portal.NoSuchPermissionException,
319             com.liferay.portal.NoSuchGroupException;
320 
321     public void setPermissions(long pk,
322         java.util.List<com.liferay.portal.model.Permission> permissions)
323         throws com.liferay.portal.SystemException,
324             com.liferay.portal.NoSuchPermissionException,
325             com.liferay.portal.NoSuchGroupException;
326 
327     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk)
328         throws com.liferay.portal.SystemException,
329             com.liferay.portal.NoSuchGroupException;
330 
331     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
332         int begin, int end)
333         throws com.liferay.portal.SystemException,
334             com.liferay.portal.NoSuchGroupException;
335 
336     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
337         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
338         throws com.liferay.portal.SystemException,
339             com.liferay.portal.NoSuchGroupException;
340 
341     public int getRolesSize(long pk) throws com.liferay.portal.SystemException;
342 
343     public boolean containsRole(long pk, long rolePK)
344         throws com.liferay.portal.SystemException;
345 
346     public boolean containsRoles(long pk)
347         throws com.liferay.portal.SystemException;
348 
349     public void addRole(long pk, long rolePK)
350         throws com.liferay.portal.SystemException,
351             com.liferay.portal.NoSuchRoleException,
352             com.liferay.portal.NoSuchGroupException;
353 
354     public void addRole(long pk, com.liferay.portal.model.Role role)
355         throws com.liferay.portal.SystemException,
356             com.liferay.portal.NoSuchRoleException,
357             com.liferay.portal.NoSuchGroupException;
358 
359     public void addRoles(long pk, long[] rolePKs)
360         throws com.liferay.portal.SystemException,
361             com.liferay.portal.NoSuchRoleException,
362             com.liferay.portal.NoSuchGroupException;
363 
364     public void addRoles(long pk,
365         java.util.List<com.liferay.portal.model.Role> roles)
366         throws com.liferay.portal.SystemException,
367             com.liferay.portal.NoSuchRoleException,
368             com.liferay.portal.NoSuchGroupException;
369 
370     public void clearRoles(long pk)
371         throws com.liferay.portal.SystemException,
372             com.liferay.portal.NoSuchGroupException;
373 
374     public void removeRole(long pk, long rolePK)
375         throws com.liferay.portal.SystemException,
376             com.liferay.portal.NoSuchRoleException,
377             com.liferay.portal.NoSuchGroupException;
378 
379     public void removeRole(long pk, com.liferay.portal.model.Role role)
380         throws com.liferay.portal.SystemException,
381             com.liferay.portal.NoSuchRoleException,
382             com.liferay.portal.NoSuchGroupException;
383 
384     public void removeRoles(long pk, long[] rolePKs)
385         throws com.liferay.portal.SystemException,
386             com.liferay.portal.NoSuchRoleException,
387             com.liferay.portal.NoSuchGroupException;
388 
389     public void removeRoles(long pk,
390         java.util.List<com.liferay.portal.model.Role> roles)
391         throws com.liferay.portal.SystemException,
392             com.liferay.portal.NoSuchRoleException,
393             com.liferay.portal.NoSuchGroupException;
394 
395     public void setRoles(long pk, long[] rolePKs)
396         throws com.liferay.portal.SystemException,
397             com.liferay.portal.NoSuchRoleException,
398             com.liferay.portal.NoSuchGroupException;
399 
400     public void setRoles(long pk,
401         java.util.List<com.liferay.portal.model.Role> roles)
402         throws com.liferay.portal.SystemException,
403             com.liferay.portal.NoSuchRoleException,
404             com.liferay.portal.NoSuchGroupException;
405 
406     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
407         long pk)
408         throws com.liferay.portal.SystemException,
409             com.liferay.portal.NoSuchGroupException;
410 
411     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
412         long pk, int begin, int end)
413         throws com.liferay.portal.SystemException,
414             com.liferay.portal.NoSuchGroupException;
415 
416     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
417         long pk, int begin, int end,
418         com.liferay.portal.kernel.util.OrderByComparator obc)
419         throws com.liferay.portal.SystemException,
420             com.liferay.portal.NoSuchGroupException;
421 
422     public int getUserGroupsSize(long pk)
423         throws com.liferay.portal.SystemException;
424 
425     public boolean containsUserGroup(long pk, long userGroupPK)
426         throws com.liferay.portal.SystemException;
427 
428     public boolean containsUserGroups(long pk)
429         throws com.liferay.portal.SystemException;
430 
431     public void addUserGroup(long pk, long userGroupPK)
432         throws com.liferay.portal.SystemException,
433             com.liferay.portal.NoSuchGroupException,
434             com.liferay.portal.NoSuchUserGroupException;
435 
436     public void addUserGroup(long pk,
437         com.liferay.portal.model.UserGroup userGroup)
438         throws com.liferay.portal.SystemException,
439             com.liferay.portal.NoSuchGroupException,
440             com.liferay.portal.NoSuchUserGroupException;
441 
442     public void addUserGroups(long pk, long[] userGroupPKs)
443         throws com.liferay.portal.SystemException,
444             com.liferay.portal.NoSuchGroupException,
445             com.liferay.portal.NoSuchUserGroupException;
446 
447     public void addUserGroups(long pk,
448         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
449         throws com.liferay.portal.SystemException,
450             com.liferay.portal.NoSuchGroupException,
451             com.liferay.portal.NoSuchUserGroupException;
452 
453     public void clearUserGroups(long pk)
454         throws com.liferay.portal.SystemException,
455             com.liferay.portal.NoSuchGroupException;
456 
457     public void removeUserGroup(long pk, long userGroupPK)
458         throws com.liferay.portal.SystemException,
459             com.liferay.portal.NoSuchGroupException,
460             com.liferay.portal.NoSuchUserGroupException;
461 
462     public void removeUserGroup(long pk,
463         com.liferay.portal.model.UserGroup userGroup)
464         throws com.liferay.portal.SystemException,
465             com.liferay.portal.NoSuchGroupException,
466             com.liferay.portal.NoSuchUserGroupException;
467 
468     public void removeUserGroups(long pk, long[] userGroupPKs)
469         throws com.liferay.portal.SystemException,
470             com.liferay.portal.NoSuchGroupException,
471             com.liferay.portal.NoSuchUserGroupException;
472 
473     public void removeUserGroups(long pk,
474         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
475         throws com.liferay.portal.SystemException,
476             com.liferay.portal.NoSuchGroupException,
477             com.liferay.portal.NoSuchUserGroupException;
478 
479     public void setUserGroups(long pk, long[] userGroupPKs)
480         throws com.liferay.portal.SystemException,
481             com.liferay.portal.NoSuchGroupException,
482             com.liferay.portal.NoSuchUserGroupException;
483 
484     public void setUserGroups(long pk,
485         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
486         throws com.liferay.portal.SystemException,
487             com.liferay.portal.NoSuchGroupException,
488             com.liferay.portal.NoSuchUserGroupException;
489 
490     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
491         throws com.liferay.portal.SystemException,
492             com.liferay.portal.NoSuchGroupException;
493 
494     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
495         int begin, int end)
496         throws com.liferay.portal.SystemException,
497             com.liferay.portal.NoSuchGroupException;
498 
499     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
500         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
501         throws com.liferay.portal.SystemException,
502             com.liferay.portal.NoSuchGroupException;
503 
504     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
505 
506     public boolean containsUser(long pk, long userPK)
507         throws com.liferay.portal.SystemException;
508 
509     public boolean containsUsers(long pk)
510         throws com.liferay.portal.SystemException;
511 
512     public void addUser(long pk, long userPK)
513         throws com.liferay.portal.SystemException,
514             com.liferay.portal.NoSuchGroupException,
515             com.liferay.portal.NoSuchUserException;
516 
517     public void addUser(long pk, com.liferay.portal.model.User user)
518         throws com.liferay.portal.SystemException,
519             com.liferay.portal.NoSuchGroupException,
520             com.liferay.portal.NoSuchUserException;
521 
522     public void addUsers(long pk, long[] userPKs)
523         throws com.liferay.portal.SystemException,
524             com.liferay.portal.NoSuchGroupException,
525             com.liferay.portal.NoSuchUserException;
526 
527     public void addUsers(long pk,
528         java.util.List<com.liferay.portal.model.User> users)
529         throws com.liferay.portal.SystemException,
530             com.liferay.portal.NoSuchGroupException,
531             com.liferay.portal.NoSuchUserException;
532 
533     public void clearUsers(long pk)
534         throws com.liferay.portal.SystemException,
535             com.liferay.portal.NoSuchGroupException;
536 
537     public void removeUser(long pk, long userPK)
538         throws com.liferay.portal.SystemException,
539             com.liferay.portal.NoSuchGroupException,
540             com.liferay.portal.NoSuchUserException;
541 
542     public void removeUser(long pk, com.liferay.portal.model.User user)
543         throws com.liferay.portal.SystemException,
544             com.liferay.portal.NoSuchGroupException,
545             com.liferay.portal.NoSuchUserException;
546 
547     public void removeUsers(long pk, long[] userPKs)
548         throws com.liferay.portal.SystemException,
549             com.liferay.portal.NoSuchGroupException,
550             com.liferay.portal.NoSuchUserException;
551 
552     public void removeUsers(long pk,
553         java.util.List<com.liferay.portal.model.User> users)
554         throws com.liferay.portal.SystemException,
555             com.liferay.portal.NoSuchGroupException,
556             com.liferay.portal.NoSuchUserException;
557 
558     public void setUsers(long pk, long[] userPKs)
559         throws com.liferay.portal.SystemException,
560             com.liferay.portal.NoSuchGroupException,
561             com.liferay.portal.NoSuchUserException;
562 
563     public void setUsers(long pk,
564         java.util.List<com.liferay.portal.model.User> users)
565         throws com.liferay.portal.SystemException,
566             com.liferay.portal.NoSuchGroupException,
567             com.liferay.portal.NoSuchUserException;
568 }