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  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.Propagation;
28  import com.liferay.portal.kernel.annotation.Transactional;
29  
30  /**
31   * <a href="GroupPersistence.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Brian Wing Shun Chan
34   *
35   */
36  @Transactional(rollbackFor =  {
37      PortalException.class, SystemException.class})
38  public interface GroupPersistence extends BasePersistence {
39      public com.liferay.portal.model.Group create(long groupId);
40  
41      public com.liferay.portal.model.Group remove(long groupId)
42          throws com.liferay.portal.NoSuchGroupException,
43              com.liferay.portal.SystemException;
44  
45      public com.liferay.portal.model.Group remove(
46          com.liferay.portal.model.Group group)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * @deprecated Use <code>update(Group group, boolean merge)</code>.
51       */
52      public com.liferay.portal.model.Group update(
53          com.liferay.portal.model.Group group)
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        group 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 group 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.Group update(
70          com.liferay.portal.model.Group group, boolean merge)
71          throws com.liferay.portal.SystemException;
72  
73      public com.liferay.portal.model.Group updateImpl(
74          com.liferay.portal.model.Group group, boolean merge)
75          throws com.liferay.portal.SystemException;
76  
77      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
78      public com.liferay.portal.model.Group findByPrimaryKey(long groupId)
79          throws com.liferay.portal.NoSuchGroupException,
80              com.liferay.portal.SystemException;
81  
82      public com.liferay.portal.model.Group fetchByPrimaryKey(long groupId)
83          throws com.liferay.portal.SystemException;
84  
85      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
86      public com.liferay.portal.model.Group findByLiveGroupId(long liveGroupId)
87          throws com.liferay.portal.NoSuchGroupException,
88              com.liferay.portal.SystemException;
89  
90      public com.liferay.portal.model.Group fetchByLiveGroupId(long liveGroupId)
91          throws com.liferay.portal.SystemException;
92  
93      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
94      public com.liferay.portal.model.Group findByC_N(long companyId,
95          java.lang.String name)
96          throws com.liferay.portal.NoSuchGroupException,
97              com.liferay.portal.SystemException;
98  
99      public com.liferay.portal.model.Group fetchByC_N(long companyId,
100         java.lang.String name) throws com.liferay.portal.SystemException;
101 
102     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
103     public com.liferay.portal.model.Group findByC_F(long companyId,
104         java.lang.String friendlyURL)
105         throws com.liferay.portal.NoSuchGroupException,
106             com.liferay.portal.SystemException;
107 
108     public com.liferay.portal.model.Group fetchByC_F(long companyId,
109         java.lang.String friendlyURL) throws com.liferay.portal.SystemException;
110 
111     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
112     public com.liferay.portal.model.Group findByC_C_C(long companyId,
113         long classNameId, long classPK)
114         throws com.liferay.portal.NoSuchGroupException,
115             com.liferay.portal.SystemException;
116 
117     public com.liferay.portal.model.Group fetchByC_C_C(long companyId,
118         long classNameId, long classPK)
119         throws com.liferay.portal.SystemException;
120 
121     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
122     public java.util.List<Object> findWithDynamicQuery(
123         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
124         throws com.liferay.portal.SystemException;
125 
126     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
127     public java.util.List<Object> findWithDynamicQuery(
128         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
129         int end) throws com.liferay.portal.SystemException;
130 
131     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132     public java.util.List<com.liferay.portal.model.Group> findAll()
133         throws com.liferay.portal.SystemException;
134 
135     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
136     public java.util.List<com.liferay.portal.model.Group> findAll(int start,
137         int end) throws com.liferay.portal.SystemException;
138 
139     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
140     public java.util.List<com.liferay.portal.model.Group> findAll(int start,
141         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException;
143 
144     public void removeByLiveGroupId(long liveGroupId)
145         throws com.liferay.portal.NoSuchGroupException,
146             com.liferay.portal.SystemException;
147 
148     public void removeByC_N(long companyId, java.lang.String name)
149         throws com.liferay.portal.NoSuchGroupException,
150             com.liferay.portal.SystemException;
151 
152     public void removeByC_F(long companyId, java.lang.String friendlyURL)
153         throws com.liferay.portal.NoSuchGroupException,
154             com.liferay.portal.SystemException;
155 
156     public void removeByC_C_C(long companyId, long classNameId, long classPK)
157         throws com.liferay.portal.NoSuchGroupException,
158             com.liferay.portal.SystemException;
159 
160     public void removeAll() throws com.liferay.portal.SystemException;
161 
162     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
163     public int countByLiveGroupId(long liveGroupId)
164         throws com.liferay.portal.SystemException;
165 
166     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167     public int countByC_N(long companyId, java.lang.String name)
168         throws com.liferay.portal.SystemException;
169 
170     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171     public int countByC_F(long companyId, java.lang.String friendlyURL)
172         throws com.liferay.portal.SystemException;
173 
174     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
175     public int countByC_C_C(long companyId, long classNameId, long classPK)
176         throws com.liferay.portal.SystemException;
177 
178     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179     public int countAll() throws com.liferay.portal.SystemException;
180 
181     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
183         long pk) throws com.liferay.portal.SystemException;
184 
185     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
187         long pk, int start, int end) throws com.liferay.portal.SystemException;
188 
189     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190     public java.util.List<com.liferay.portal.model.Organization> getOrganizations(
191         long pk, int start, int end,
192         com.liferay.portal.kernel.util.OrderByComparator obc)
193         throws com.liferay.portal.SystemException;
194 
195     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196     public int getOrganizationsSize(long pk)
197         throws com.liferay.portal.SystemException;
198 
199     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200     public boolean containsOrganization(long pk, long organizationPK)
201         throws com.liferay.portal.SystemException;
202 
203     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204     public boolean containsOrganizations(long pk)
205         throws com.liferay.portal.SystemException;
206 
207     public void addOrganization(long pk, long organizationPK)
208         throws com.liferay.portal.SystemException;
209 
210     public void addOrganization(long pk,
211         com.liferay.portal.model.Organization organization)
212         throws com.liferay.portal.SystemException;
213 
214     public void addOrganizations(long pk, long[] organizationPKs)
215         throws com.liferay.portal.SystemException;
216 
217     public void addOrganizations(long pk,
218         java.util.List<com.liferay.portal.model.Organization> organizations)
219         throws com.liferay.portal.SystemException;
220 
221     public void clearOrganizations(long pk)
222         throws com.liferay.portal.SystemException;
223 
224     public void removeOrganization(long pk, long organizationPK)
225         throws com.liferay.portal.SystemException;
226 
227     public void removeOrganization(long pk,
228         com.liferay.portal.model.Organization organization)
229         throws com.liferay.portal.SystemException;
230 
231     public void removeOrganizations(long pk, long[] organizationPKs)
232         throws com.liferay.portal.SystemException;
233 
234     public void removeOrganizations(long pk,
235         java.util.List<com.liferay.portal.model.Organization> organizations)
236         throws com.liferay.portal.SystemException;
237 
238     public void setOrganizations(long pk, long[] organizationPKs)
239         throws com.liferay.portal.SystemException;
240 
241     public void setOrganizations(long pk,
242         java.util.List<com.liferay.portal.model.Organization> organizations)
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.Role> getRoles(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.Role> getRoles(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.Role> getRoles(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 getRolesSize(long pk) throws com.liferay.portal.SystemException;
324 
325     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326     public boolean containsRole(long pk, long rolePK)
327         throws com.liferay.portal.SystemException;
328 
329     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330     public boolean containsRoles(long pk)
331         throws com.liferay.portal.SystemException;
332 
333     public void addRole(long pk, long rolePK)
334         throws com.liferay.portal.SystemException;
335 
336     public void addRole(long pk, com.liferay.portal.model.Role role)
337         throws com.liferay.portal.SystemException;
338 
339     public void addRoles(long pk, long[] rolePKs)
340         throws com.liferay.portal.SystemException;
341 
342     public void addRoles(long pk,
343         java.util.List<com.liferay.portal.model.Role> roles)
344         throws com.liferay.portal.SystemException;
345 
346     public void clearRoles(long pk) throws com.liferay.portal.SystemException;
347 
348     public void removeRole(long pk, long rolePK)
349         throws com.liferay.portal.SystemException;
350 
351     public void removeRole(long pk, com.liferay.portal.model.Role role)
352         throws com.liferay.portal.SystemException;
353 
354     public void removeRoles(long pk, long[] rolePKs)
355         throws com.liferay.portal.SystemException;
356 
357     public void removeRoles(long pk,
358         java.util.List<com.liferay.portal.model.Role> roles)
359         throws com.liferay.portal.SystemException;
360 
361     public void setRoles(long pk, long[] rolePKs)
362         throws com.liferay.portal.SystemException;
363 
364     public void setRoles(long pk,
365         java.util.List<com.liferay.portal.model.Role> roles)
366         throws com.liferay.portal.SystemException;
367 
368     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
369     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
370         long pk) throws com.liferay.portal.SystemException;
371 
372     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
373     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
374         long pk, int start, int end) throws com.liferay.portal.SystemException;
375 
376     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
377     public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
378         long pk, int start, int end,
379         com.liferay.portal.kernel.util.OrderByComparator obc)
380         throws com.liferay.portal.SystemException;
381 
382     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
383     public int getUserGroupsSize(long pk)
384         throws com.liferay.portal.SystemException;
385 
386     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
387     public boolean containsUserGroup(long pk, long userGroupPK)
388         throws com.liferay.portal.SystemException;
389 
390     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391     public boolean containsUserGroups(long pk)
392         throws com.liferay.portal.SystemException;
393 
394     public void addUserGroup(long pk, long userGroupPK)
395         throws com.liferay.portal.SystemException;
396 
397     public void addUserGroup(long pk,
398         com.liferay.portal.model.UserGroup userGroup)
399         throws com.liferay.portal.SystemException;
400 
401     public void addUserGroups(long pk, long[] userGroupPKs)
402         throws com.liferay.portal.SystemException;
403 
404     public void addUserGroups(long pk,
405         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
406         throws com.liferay.portal.SystemException;
407 
408     public void clearUserGroups(long pk)
409         throws com.liferay.portal.SystemException;
410 
411     public void removeUserGroup(long pk, long userGroupPK)
412         throws com.liferay.portal.SystemException;
413 
414     public void removeUserGroup(long pk,
415         com.liferay.portal.model.UserGroup userGroup)
416         throws com.liferay.portal.SystemException;
417 
418     public void removeUserGroups(long pk, long[] userGroupPKs)
419         throws com.liferay.portal.SystemException;
420 
421     public void removeUserGroups(long pk,
422         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
423         throws com.liferay.portal.SystemException;
424 
425     public void setUserGroups(long pk, long[] userGroupPKs)
426         throws com.liferay.portal.SystemException;
427 
428     public void setUserGroups(long pk,
429         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
430         throws com.liferay.portal.SystemException;
431 
432     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
433     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
434         throws com.liferay.portal.SystemException;
435 
436     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
437     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
438         int start, int end) throws com.liferay.portal.SystemException;
439 
440     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
441     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
442         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
443         throws com.liferay.portal.SystemException;
444 
445     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
446     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
447 
448     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
449     public boolean containsUser(long pk, long userPK)
450         throws com.liferay.portal.SystemException;
451 
452     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
453     public boolean containsUsers(long pk)
454         throws com.liferay.portal.SystemException;
455 
456     public void addUser(long pk, long userPK)
457         throws com.liferay.portal.SystemException;
458 
459     public void addUser(long pk, com.liferay.portal.model.User user)
460         throws com.liferay.portal.SystemException;
461 
462     public void addUsers(long pk, long[] userPKs)
463         throws com.liferay.portal.SystemException;
464 
465     public void addUsers(long pk,
466         java.util.List<com.liferay.portal.model.User> users)
467         throws com.liferay.portal.SystemException;
468 
469     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
470 
471     public void removeUser(long pk, long userPK)
472         throws com.liferay.portal.SystemException;
473 
474     public void removeUser(long pk, com.liferay.portal.model.User user)
475         throws com.liferay.portal.SystemException;
476 
477     public void removeUsers(long pk, long[] userPKs)
478         throws com.liferay.portal.SystemException;
479 
480     public void removeUsers(long pk,
481         java.util.List<com.liferay.portal.model.User> users)
482         throws com.liferay.portal.SystemException;
483 
484     public void setUsers(long pk, long[] userPKs)
485         throws com.liferay.portal.SystemException;
486 
487     public void setUsers(long pk,
488         java.util.List<com.liferay.portal.model.User> users)
489         throws com.liferay.portal.SystemException;
490 }