1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="UserGroupPersistence.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public interface UserGroupPersistence extends BasePersistence {
29      public void cacheResult(com.liferay.portal.model.UserGroup userGroup);
30  
31      public void cacheResult(
32          java.util.List<com.liferay.portal.model.UserGroup> userGroups);
33  
34      public void clearCache();
35  
36      public com.liferay.portal.model.UserGroup create(long userGroupId);
37  
38      public com.liferay.portal.model.UserGroup remove(long userGroupId)
39          throws com.liferay.portal.NoSuchUserGroupException,
40              com.liferay.portal.SystemException;
41  
42      public com.liferay.portal.model.UserGroup remove(
43          com.liferay.portal.model.UserGroup userGroup)
44          throws com.liferay.portal.SystemException;
45  
46      /**
47       * @deprecated Use <code>update(UserGroup userGroup, boolean merge)</code>.
48       */
49      public com.liferay.portal.model.UserGroup update(
50          com.liferay.portal.model.UserGroup userGroup)
51          throws com.liferay.portal.SystemException;
52  
53      /**
54       * Add, update, or merge, the entity. This method also calls the model
55       * listeners to trigger the proper events associated with adding, deleting,
56       * or updating an entity.
57       *
58       * @param        userGroup the entity to add, update, or merge
59       * @param        merge boolean value for whether to merge the entity. The
60       *                default value is false. Setting merge to true is more
61       *                expensive and should only be true when userGroup is
62       *                transient. See LEP-5473 for a detailed discussion of this
63       *                method.
64       * @return        true if the portlet can be displayed via Ajax
65       */
66      public com.liferay.portal.model.UserGroup update(
67          com.liferay.portal.model.UserGroup userGroup, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.UserGroup updateImpl(
71          com.liferay.portal.model.UserGroup userGroup, boolean merge)
72          throws com.liferay.portal.SystemException;
73  
74      public com.liferay.portal.model.UserGroup findByPrimaryKey(long userGroupId)
75          throws com.liferay.portal.NoSuchUserGroupException,
76              com.liferay.portal.SystemException;
77  
78      public com.liferay.portal.model.UserGroup fetchByPrimaryKey(
79          long userGroupId) throws com.liferay.portal.SystemException;
80  
81      public java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
82          long companyId) 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          throws com.liferay.portal.SystemException;
87  
88      public java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
89          long companyId, int start, int end,
90          com.liferay.portal.kernel.util.OrderByComparator obc)
91          throws com.liferay.portal.SystemException;
92  
93      public com.liferay.portal.model.UserGroup findByCompanyId_First(
94          long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
95          throws com.liferay.portal.NoSuchUserGroupException,
96              com.liferay.portal.SystemException;
97  
98      public com.liferay.portal.model.UserGroup findByCompanyId_Last(
99          long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
100         throws com.liferay.portal.NoSuchUserGroupException,
101             com.liferay.portal.SystemException;
102 
103     public com.liferay.portal.model.UserGroup[] findByCompanyId_PrevAndNext(
104         long userGroupId, long companyId,
105         com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.NoSuchUserGroupException,
107             com.liferay.portal.SystemException;
108 
109     public java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
110         long companyId, long parentUserGroupId)
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         throws com.liferay.portal.SystemException;
116 
117     public java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
118         long companyId, long parentUserGroupId, int start, int end,
119         com.liferay.portal.kernel.util.OrderByComparator obc)
120         throws com.liferay.portal.SystemException;
121 
122     public com.liferay.portal.model.UserGroup findByC_P_First(long companyId,
123         long parentUserGroupId,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.NoSuchUserGroupException,
126             com.liferay.portal.SystemException;
127 
128     public com.liferay.portal.model.UserGroup findByC_P_Last(long companyId,
129         long parentUserGroupId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.NoSuchUserGroupException,
132             com.liferay.portal.SystemException;
133 
134     public com.liferay.portal.model.UserGroup[] findByC_P_PrevAndNext(
135         long userGroupId, long companyId, long parentUserGroupId,
136         com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.NoSuchUserGroupException,
138             com.liferay.portal.SystemException;
139 
140     public com.liferay.portal.model.UserGroup findByC_N(long companyId,
141         java.lang.String name)
142         throws com.liferay.portal.NoSuchUserGroupException,
143             com.liferay.portal.SystemException;
144 
145     public com.liferay.portal.model.UserGroup fetchByC_N(long companyId,
146         java.lang.String name) throws com.liferay.portal.SystemException;
147 
148     public com.liferay.portal.model.UserGroup fetchByC_N(long companyId,
149         java.lang.String name, boolean retrieveFromCache)
150         throws com.liferay.portal.SystemException;
151 
152     public java.util.List<Object> findWithDynamicQuery(
153         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
154         throws com.liferay.portal.SystemException;
155 
156     public java.util.List<Object> findWithDynamicQuery(
157         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
158         int end) throws com.liferay.portal.SystemException;
159 
160     public java.util.List<com.liferay.portal.model.UserGroup> findAll()
161         throws com.liferay.portal.SystemException;
162 
163     public java.util.List<com.liferay.portal.model.UserGroup> findAll(
164         int start, int end) throws com.liferay.portal.SystemException;
165 
166     public java.util.List<com.liferay.portal.model.UserGroup> findAll(
167         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
168         throws com.liferay.portal.SystemException;
169 
170     public void removeByCompanyId(long companyId)
171         throws com.liferay.portal.SystemException;
172 
173     public void removeByC_P(long companyId, long parentUserGroupId)
174         throws com.liferay.portal.SystemException;
175 
176     public void removeByC_N(long companyId, java.lang.String name)
177         throws com.liferay.portal.NoSuchUserGroupException,
178             com.liferay.portal.SystemException;
179 
180     public void removeAll() throws com.liferay.portal.SystemException;
181 
182     public int countByCompanyId(long companyId)
183         throws com.liferay.portal.SystemException;
184 
185     public int countByC_P(long companyId, long parentUserGroupId)
186         throws com.liferay.portal.SystemException;
187 
188     public int countByC_N(long companyId, java.lang.String name)
189         throws com.liferay.portal.SystemException;
190 
191     public int countAll() throws com.liferay.portal.SystemException;
192 
193     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
194         throws com.liferay.portal.SystemException;
195 
196     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
197         int start, int end) throws com.liferay.portal.SystemException;
198 
199     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
200         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
201         throws com.liferay.portal.SystemException;
202 
203     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
204 
205     public boolean containsUser(long pk, long userPK)
206         throws com.liferay.portal.SystemException;
207 
208     public boolean containsUsers(long pk)
209         throws com.liferay.portal.SystemException;
210 
211     public void addUser(long pk, long userPK)
212         throws com.liferay.portal.SystemException;
213 
214     public void addUser(long pk, com.liferay.portal.model.User user)
215         throws com.liferay.portal.SystemException;
216 
217     public void addUsers(long pk, long[] userPKs)
218         throws com.liferay.portal.SystemException;
219 
220     public void addUsers(long pk,
221         java.util.List<com.liferay.portal.model.User> users)
222         throws com.liferay.portal.SystemException;
223 
224     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
225 
226     public void removeUser(long pk, long userPK)
227         throws com.liferay.portal.SystemException;
228 
229     public void removeUser(long pk, com.liferay.portal.model.User user)
230         throws com.liferay.portal.SystemException;
231 
232     public void removeUsers(long pk, long[] userPKs)
233         throws com.liferay.portal.SystemException;
234 
235     public void removeUsers(long pk,
236         java.util.List<com.liferay.portal.model.User> users)
237         throws com.liferay.portal.SystemException;
238 
239     public void setUsers(long pk, long[] userPKs)
240         throws com.liferay.portal.SystemException;
241 
242     public void setUsers(long pk,
243         java.util.List<com.liferay.portal.model.User> users)
244         throws com.liferay.portal.SystemException;
245 }