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.SystemException,
36              com.liferay.portal.NoSuchUserGroupException;
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.SystemException,
72              com.liferay.portal.NoSuchUserGroupException;
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 begin, int end)
82          throws com.liferay.portal.SystemException;
83  
84      public java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
85          long companyId, int begin, 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.SystemException,
92              com.liferay.portal.NoSuchUserGroupException;
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.SystemException,
97              com.liferay.portal.NoSuchUserGroupException;
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.SystemException,
103             com.liferay.portal.NoSuchUserGroupException;
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 begin, 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 begin, 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.SystemException,
122             com.liferay.portal.NoSuchUserGroupException;
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.SystemException,
128             com.liferay.portal.NoSuchUserGroupException;
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.SystemException,
134             com.liferay.portal.NoSuchUserGroupException;
135 
136     public com.liferay.portal.model.UserGroup findByC_N(long companyId,
137         java.lang.String name)
138         throws com.liferay.portal.SystemException,
139             com.liferay.portal.NoSuchUserGroupException;
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<com.liferay.portal.model.UserGroup> findWithDynamicQuery(
145         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
146         throws com.liferay.portal.SystemException;
147 
148     public java.util.List<com.liferay.portal.model.UserGroup> findWithDynamicQuery(
149         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
150         int begin, 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 begin, int end) throws com.liferay.portal.SystemException;
157 
158     public java.util.List<com.liferay.portal.model.UserGroup> findAll(
159         int begin, 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.SystemException,
170             com.liferay.portal.NoSuchUserGroupException;
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             com.liferay.portal.NoSuchUserGroupException;
188 
189     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
190         int begin, int end)
191         throws com.liferay.portal.SystemException,
192             com.liferay.portal.NoSuchUserGroupException;
193 
194     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
195         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
196         throws com.liferay.portal.SystemException,
197             com.liferay.portal.NoSuchUserGroupException;
198 
199     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
200 
201     public boolean containsUser(long pk, long userPK)
202         throws com.liferay.portal.SystemException;
203 
204     public boolean containsUsers(long pk)
205         throws com.liferay.portal.SystemException;
206 
207     public void addUser(long pk, long userPK)
208         throws com.liferay.portal.SystemException,
209             com.liferay.portal.NoSuchUserGroupException,
210             com.liferay.portal.NoSuchUserException;
211 
212     public void addUser(long pk, com.liferay.portal.model.User user)
213         throws com.liferay.portal.SystemException,
214             com.liferay.portal.NoSuchUserGroupException,
215             com.liferay.portal.NoSuchUserException;
216 
217     public void addUsers(long pk, long[] userPKs)
218         throws com.liferay.portal.SystemException,
219             com.liferay.portal.NoSuchUserGroupException,
220             com.liferay.portal.NoSuchUserException;
221 
222     public void addUsers(long pk,
223         java.util.List<com.liferay.portal.model.User> users)
224         throws com.liferay.portal.SystemException,
225             com.liferay.portal.NoSuchUserGroupException,
226             com.liferay.portal.NoSuchUserException;
227 
228     public void clearUsers(long pk)
229         throws com.liferay.portal.SystemException,
230             com.liferay.portal.NoSuchUserGroupException;
231 
232     public void removeUser(long pk, long userPK)
233         throws com.liferay.portal.SystemException,
234             com.liferay.portal.NoSuchUserGroupException,
235             com.liferay.portal.NoSuchUserException;
236 
237     public void removeUser(long pk, com.liferay.portal.model.User user)
238         throws com.liferay.portal.SystemException,
239             com.liferay.portal.NoSuchUserGroupException,
240             com.liferay.portal.NoSuchUserException;
241 
242     public void removeUsers(long pk, long[] userPKs)
243         throws com.liferay.portal.SystemException,
244             com.liferay.portal.NoSuchUserGroupException,
245             com.liferay.portal.NoSuchUserException;
246 
247     public void removeUsers(long pk,
248         java.util.List<com.liferay.portal.model.User> users)
249         throws com.liferay.portal.SystemException,
250             com.liferay.portal.NoSuchUserGroupException,
251             com.liferay.portal.NoSuchUserException;
252 
253     public void setUsers(long pk, long[] userPKs)
254         throws com.liferay.portal.SystemException,
255             com.liferay.portal.NoSuchUserGroupException,
256             com.liferay.portal.NoSuchUserException;
257 
258     public void setUsers(long pk,
259         java.util.List<com.liferay.portal.model.User> users)
260         throws com.liferay.portal.SystemException,
261             com.liferay.portal.NoSuchUserGroupException,
262             com.liferay.portal.NoSuchUserException;
263 }