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="UserGroupPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface UserGroupPersistence {
32      public com.liferay.portal.model.UserGroup create(long userGroupId);
33  
34      public com.liferay.portal.model.UserGroup remove(long userGroupId)
35          throws com.liferay.portal.NoSuchUserGroupException,
36              com.liferay.portal.SystemException;
37  
38      public com.liferay.portal.model.UserGroup remove(
39          com.liferay.portal.model.UserGroup userGroup)
40          throws com.liferay.portal.SystemException;
41  
42      /**
43       * @deprecated Use <code>update(UserGroup userGroup, boolean merge)</code>.
44       */
45      public com.liferay.portal.model.UserGroup update(
46          com.liferay.portal.model.UserGroup userGroup)
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        userGroup 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 userGroup 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.UserGroup update(
63          com.liferay.portal.model.UserGroup userGroup, boolean merge)
64          throws com.liferay.portal.SystemException;
65  
66      public com.liferay.portal.model.UserGroup updateImpl(
67          com.liferay.portal.model.UserGroup userGroup, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.UserGroup findByPrimaryKey(long userGroupId)
71          throws com.liferay.portal.NoSuchUserGroupException,
72              com.liferay.portal.SystemException;
73  
74      public com.liferay.portal.model.UserGroup fetchByPrimaryKey(
75          long userGroupId) throws com.liferay.portal.SystemException;
76  
77      public java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
78          long companyId) throws com.liferay.portal.SystemException;
79  
80      public java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
81          long companyId, int start, int end)
82          throws com.liferay.portal.SystemException;
83  
84      public java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
85          long companyId, int start, int end,
86          com.liferay.portal.kernel.util.OrderByComparator obc)
87          throws com.liferay.portal.SystemException;
88  
89      public com.liferay.portal.model.UserGroup findByCompanyId_First(
90          long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
91          throws com.liferay.portal.NoSuchUserGroupException,
92              com.liferay.portal.SystemException;
93  
94      public com.liferay.portal.model.UserGroup findByCompanyId_Last(
95          long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.NoSuchUserGroupException,
97              com.liferay.portal.SystemException;
98  
99      public com.liferay.portal.model.UserGroup[] findByCompanyId_PrevAndNext(
100         long userGroupId, long companyId,
101         com.liferay.portal.kernel.util.OrderByComparator obc)
102         throws com.liferay.portal.NoSuchUserGroupException,
103             com.liferay.portal.SystemException;
104 
105     public java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
106         long companyId, long parentUserGroupId)
107         throws com.liferay.portal.SystemException;
108 
109     public java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
110         long companyId, long parentUserGroupId, int start, int end)
111         throws com.liferay.portal.SystemException;
112 
113     public java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
114         long companyId, long parentUserGroupId, int start, int end,
115         com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException;
117 
118     public com.liferay.portal.model.UserGroup findByC_P_First(long companyId,
119         long parentUserGroupId,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.NoSuchUserGroupException,
122             com.liferay.portal.SystemException;
123 
124     public com.liferay.portal.model.UserGroup findByC_P_Last(long companyId,
125         long parentUserGroupId,
126         com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.NoSuchUserGroupException,
128             com.liferay.portal.SystemException;
129 
130     public com.liferay.portal.model.UserGroup[] findByC_P_PrevAndNext(
131         long userGroupId, long companyId, long parentUserGroupId,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.NoSuchUserGroupException,
134             com.liferay.portal.SystemException;
135 
136     public com.liferay.portal.model.UserGroup findByC_N(long companyId,
137         java.lang.String name)
138         throws com.liferay.portal.NoSuchUserGroupException,
139             com.liferay.portal.SystemException;
140 
141     public com.liferay.portal.model.UserGroup fetchByC_N(long companyId,
142         java.lang.String name) throws com.liferay.portal.SystemException;
143 
144     public java.util.List<Object> findWithDynamicQuery(
145         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
146         throws com.liferay.portal.SystemException;
147 
148     public java.util.List<Object> findWithDynamicQuery(
149         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
150         int end) throws com.liferay.portal.SystemException;
151 
152     public java.util.List<com.liferay.portal.model.UserGroup> findAll()
153         throws com.liferay.portal.SystemException;
154 
155     public java.util.List<com.liferay.portal.model.UserGroup> findAll(
156         int start, int end) throws com.liferay.portal.SystemException;
157 
158     public java.util.List<com.liferay.portal.model.UserGroup> findAll(
159         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
160         throws com.liferay.portal.SystemException;
161 
162     public void removeByCompanyId(long companyId)
163         throws com.liferay.portal.SystemException;
164 
165     public void removeByC_P(long companyId, long parentUserGroupId)
166         throws com.liferay.portal.SystemException;
167 
168     public void removeByC_N(long companyId, java.lang.String name)
169         throws com.liferay.portal.NoSuchUserGroupException,
170             com.liferay.portal.SystemException;
171 
172     public void removeAll() throws com.liferay.portal.SystemException;
173 
174     public int countByCompanyId(long companyId)
175         throws com.liferay.portal.SystemException;
176 
177     public int countByC_P(long companyId, long parentUserGroupId)
178         throws com.liferay.portal.SystemException;
179 
180     public int countByC_N(long companyId, java.lang.String name)
181         throws com.liferay.portal.SystemException;
182 
183     public int countAll() throws com.liferay.portal.SystemException;
184 
185     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
186         throws com.liferay.portal.SystemException;
187 
188     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
189         int start, int end) throws com.liferay.portal.SystemException;
190 
191     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
192         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
193         throws com.liferay.portal.SystemException;
194 
195     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
196 
197     public boolean containsUser(long pk, long userPK)
198         throws com.liferay.portal.SystemException;
199 
200     public boolean containsUsers(long pk)
201         throws com.liferay.portal.SystemException;
202 
203     public void addUser(long pk, long userPK)
204         throws com.liferay.portal.SystemException;
205 
206     public void addUser(long pk, com.liferay.portal.model.User user)
207         throws com.liferay.portal.SystemException;
208 
209     public void addUsers(long pk, long[] userPKs)
210         throws com.liferay.portal.SystemException;
211 
212     public void addUsers(long pk,
213         java.util.List<com.liferay.portal.model.User> users)
214         throws com.liferay.portal.SystemException;
215 
216     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
217 
218     public void removeUser(long pk, long userPK)
219         throws com.liferay.portal.SystemException;
220 
221     public void removeUser(long pk, com.liferay.portal.model.User user)
222         throws com.liferay.portal.SystemException;
223 
224     public void removeUsers(long pk, long[] userPKs)
225         throws com.liferay.portal.SystemException;
226 
227     public void removeUsers(long pk,
228         java.util.List<com.liferay.portal.model.User> users)
229         throws com.liferay.portal.SystemException;
230 
231     public void setUsers(long pk, long[] userPKs)
232         throws com.liferay.portal.SystemException;
233 
234     public void setUsers(long pk,
235         java.util.List<com.liferay.portal.model.User> users)
236         throws com.liferay.portal.SystemException;
237 
238     public void registerListener(
239         com.liferay.portal.model.ModelListener listener);
240 
241     public void unregisterListener(
242         com.liferay.portal.model.ModelListener listener);
243 }