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="UserGroupUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class UserGroupUtil {
29      public static com.liferay.portal.model.UserGroup create(long userGroupId) {
30          return getPersistence().create(userGroupId);
31      }
32  
33      public static com.liferay.portal.model.UserGroup remove(long userGroupId)
34          throws com.liferay.portal.NoSuchUserGroupException,
35              com.liferay.portal.SystemException {
36          return getPersistence().remove(userGroupId);
37      }
38  
39      public static com.liferay.portal.model.UserGroup remove(
40          com.liferay.portal.model.UserGroup userGroup)
41          throws com.liferay.portal.SystemException {
42          return getPersistence().remove(userGroup);
43      }
44  
45      /**
46       * @deprecated Use <code>update(UserGroup userGroup, boolean merge)</code>.
47       */
48      public static com.liferay.portal.model.UserGroup update(
49          com.liferay.portal.model.UserGroup userGroup)
50          throws com.liferay.portal.SystemException {
51          return getPersistence().update(userGroup);
52      }
53  
54      /**
55       * Add, update, or merge, the entity. This method also calls the model
56       * listeners to trigger the proper events associated with adding, deleting,
57       * or updating an entity.
58       *
59       * @param        userGroup the entity to add, update, or merge
60       * @param        merge boolean value for whether to merge the entity. The
61       *                default value is false. Setting merge to true is more
62       *                expensive and should only be true when userGroup is
63       *                transient. See LEP-5473 for a detailed discussion of this
64       *                method.
65       * @return        true if the portlet can be displayed via Ajax
66       */
67      public static com.liferay.portal.model.UserGroup update(
68          com.liferay.portal.model.UserGroup userGroup, boolean merge)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(userGroup, merge);
71      }
72  
73      public static com.liferay.portal.model.UserGroup updateImpl(
74          com.liferay.portal.model.UserGroup userGroup, boolean merge)
75          throws com.liferay.portal.SystemException {
76          return getPersistence().updateImpl(userGroup, merge);
77      }
78  
79      public static com.liferay.portal.model.UserGroup findByPrimaryKey(
80          long userGroupId)
81          throws com.liferay.portal.NoSuchUserGroupException,
82              com.liferay.portal.SystemException {
83          return getPersistence().findByPrimaryKey(userGroupId);
84      }
85  
86      public static com.liferay.portal.model.UserGroup fetchByPrimaryKey(
87          long userGroupId) throws com.liferay.portal.SystemException {
88          return getPersistence().fetchByPrimaryKey(userGroupId);
89      }
90  
91      public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
92          long companyId) throws com.liferay.portal.SystemException {
93          return getPersistence().findByCompanyId(companyId);
94      }
95  
96      public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
97          long companyId, int start, int end)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().findByCompanyId(companyId, start, end);
100     }
101 
102     public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
103         long companyId, int start, int end,
104         com.liferay.portal.kernel.util.OrderByComparator obc)
105         throws com.liferay.portal.SystemException {
106         return getPersistence().findByCompanyId(companyId, start, end, obc);
107     }
108 
109     public static com.liferay.portal.model.UserGroup findByCompanyId_First(
110         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.NoSuchUserGroupException,
112             com.liferay.portal.SystemException {
113         return getPersistence().findByCompanyId_First(companyId, obc);
114     }
115 
116     public static com.liferay.portal.model.UserGroup findByCompanyId_Last(
117         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
118         throws com.liferay.portal.NoSuchUserGroupException,
119             com.liferay.portal.SystemException {
120         return getPersistence().findByCompanyId_Last(companyId, obc);
121     }
122 
123     public static com.liferay.portal.model.UserGroup[] findByCompanyId_PrevAndNext(
124         long userGroupId, long companyId,
125         com.liferay.portal.kernel.util.OrderByComparator obc)
126         throws com.liferay.portal.NoSuchUserGroupException,
127             com.liferay.portal.SystemException {
128         return getPersistence()
129                    .findByCompanyId_PrevAndNext(userGroupId, companyId, obc);
130     }
131 
132     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
133         long companyId, long parentUserGroupId)
134         throws com.liferay.portal.SystemException {
135         return getPersistence().findByC_P(companyId, parentUserGroupId);
136     }
137 
138     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
139         long companyId, long parentUserGroupId, int start, int end)
140         throws com.liferay.portal.SystemException {
141         return getPersistence()
142                    .findByC_P(companyId, parentUserGroupId, start, end);
143     }
144 
145     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
146         long companyId, long parentUserGroupId, int start, int end,
147         com.liferay.portal.kernel.util.OrderByComparator obc)
148         throws com.liferay.portal.SystemException {
149         return getPersistence()
150                    .findByC_P(companyId, parentUserGroupId, start, end, obc);
151     }
152 
153     public static com.liferay.portal.model.UserGroup findByC_P_First(
154         long companyId, long parentUserGroupId,
155         com.liferay.portal.kernel.util.OrderByComparator obc)
156         throws com.liferay.portal.NoSuchUserGroupException,
157             com.liferay.portal.SystemException {
158         return getPersistence()
159                    .findByC_P_First(companyId, parentUserGroupId, obc);
160     }
161 
162     public static com.liferay.portal.model.UserGroup findByC_P_Last(
163         long companyId, long parentUserGroupId,
164         com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.NoSuchUserGroupException,
166             com.liferay.portal.SystemException {
167         return getPersistence().findByC_P_Last(companyId, parentUserGroupId, obc);
168     }
169 
170     public static com.liferay.portal.model.UserGroup[] findByC_P_PrevAndNext(
171         long userGroupId, long companyId, long parentUserGroupId,
172         com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.NoSuchUserGroupException,
174             com.liferay.portal.SystemException {
175         return getPersistence()
176                    .findByC_P_PrevAndNext(userGroupId, companyId,
177             parentUserGroupId, obc);
178     }
179 
180     public static com.liferay.portal.model.UserGroup findByC_N(long companyId,
181         java.lang.String name)
182         throws com.liferay.portal.NoSuchUserGroupException,
183             com.liferay.portal.SystemException {
184         return getPersistence().findByC_N(companyId, name);
185     }
186 
187     public static com.liferay.portal.model.UserGroup fetchByC_N(
188         long companyId, java.lang.String name)
189         throws com.liferay.portal.SystemException {
190         return getPersistence().fetchByC_N(companyId, name);
191     }
192 
193     public static java.util.List<Object> findWithDynamicQuery(
194         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().findWithDynamicQuery(dynamicQuery);
197     }
198 
199     public static java.util.List<Object> findWithDynamicQuery(
200         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
201         int end) throws com.liferay.portal.SystemException {
202         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
203     }
204 
205     public static java.util.List<com.liferay.portal.model.UserGroup> findAll()
206         throws com.liferay.portal.SystemException {
207         return getPersistence().findAll();
208     }
209 
210     public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
211         int start, int end) throws com.liferay.portal.SystemException {
212         return getPersistence().findAll(start, end);
213     }
214 
215     public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
216         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().findAll(start, end, obc);
219     }
220 
221     public static void removeByCompanyId(long companyId)
222         throws com.liferay.portal.SystemException {
223         getPersistence().removeByCompanyId(companyId);
224     }
225 
226     public static void removeByC_P(long companyId, long parentUserGroupId)
227         throws com.liferay.portal.SystemException {
228         getPersistence().removeByC_P(companyId, parentUserGroupId);
229     }
230 
231     public static void removeByC_N(long companyId, java.lang.String name)
232         throws com.liferay.portal.NoSuchUserGroupException,
233             com.liferay.portal.SystemException {
234         getPersistence().removeByC_N(companyId, name);
235     }
236 
237     public static void removeAll() throws com.liferay.portal.SystemException {
238         getPersistence().removeAll();
239     }
240 
241     public static int countByCompanyId(long companyId)
242         throws com.liferay.portal.SystemException {
243         return getPersistence().countByCompanyId(companyId);
244     }
245 
246     public static int countByC_P(long companyId, long parentUserGroupId)
247         throws com.liferay.portal.SystemException {
248         return getPersistence().countByC_P(companyId, parentUserGroupId);
249     }
250 
251     public static int countByC_N(long companyId, java.lang.String name)
252         throws com.liferay.portal.SystemException {
253         return getPersistence().countByC_N(companyId, name);
254     }
255 
256     public static int countAll() throws com.liferay.portal.SystemException {
257         return getPersistence().countAll();
258     }
259 
260     public static java.util.List<com.liferay.portal.model.User> getUsers(
261         long pk) throws com.liferay.portal.SystemException {
262         return getPersistence().getUsers(pk);
263     }
264 
265     public static java.util.List<com.liferay.portal.model.User> getUsers(
266         long pk, int start, int end) throws com.liferay.portal.SystemException {
267         return getPersistence().getUsers(pk, start, end);
268     }
269 
270     public static java.util.List<com.liferay.portal.model.User> getUsers(
271         long pk, int start, int end,
272         com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.SystemException {
274         return getPersistence().getUsers(pk, start, end, obc);
275     }
276 
277     public static int getUsersSize(long pk)
278         throws com.liferay.portal.SystemException {
279         return getPersistence().getUsersSize(pk);
280     }
281 
282     public static boolean containsUser(long pk, long userPK)
283         throws com.liferay.portal.SystemException {
284         return getPersistence().containsUser(pk, userPK);
285     }
286 
287     public static boolean containsUsers(long pk)
288         throws com.liferay.portal.SystemException {
289         return getPersistence().containsUsers(pk);
290     }
291 
292     public static void addUser(long pk, long userPK)
293         throws com.liferay.portal.SystemException {
294         getPersistence().addUser(pk, userPK);
295     }
296 
297     public static void addUser(long pk, com.liferay.portal.model.User user)
298         throws com.liferay.portal.SystemException {
299         getPersistence().addUser(pk, user);
300     }
301 
302     public static void addUsers(long pk, long[] userPKs)
303         throws com.liferay.portal.SystemException {
304         getPersistence().addUsers(pk, userPKs);
305     }
306 
307     public static void addUsers(long pk,
308         java.util.List<com.liferay.portal.model.User> users)
309         throws com.liferay.portal.SystemException {
310         getPersistence().addUsers(pk, users);
311     }
312 
313     public static void clearUsers(long pk)
314         throws com.liferay.portal.SystemException {
315         getPersistence().clearUsers(pk);
316     }
317 
318     public static void removeUser(long pk, long userPK)
319         throws com.liferay.portal.SystemException {
320         getPersistence().removeUser(pk, userPK);
321     }
322 
323     public static void removeUser(long pk, com.liferay.portal.model.User user)
324         throws com.liferay.portal.SystemException {
325         getPersistence().removeUser(pk, user);
326     }
327 
328     public static void removeUsers(long pk, long[] userPKs)
329         throws com.liferay.portal.SystemException {
330         getPersistence().removeUsers(pk, userPKs);
331     }
332 
333     public static void removeUsers(long pk,
334         java.util.List<com.liferay.portal.model.User> users)
335         throws com.liferay.portal.SystemException {
336         getPersistence().removeUsers(pk, users);
337     }
338 
339     public static void setUsers(long pk, long[] userPKs)
340         throws com.liferay.portal.SystemException {
341         getPersistence().setUsers(pk, userPKs);
342     }
343 
344     public static void setUsers(long pk,
345         java.util.List<com.liferay.portal.model.User> users)
346         throws com.liferay.portal.SystemException {
347         getPersistence().setUsers(pk, users);
348     }
349 
350     public static UserGroupPersistence getPersistence() {
351         return _persistence;
352     }
353 
354     public void setPersistence(UserGroupPersistence persistence) {
355         _persistence = persistence;
356     }
357 
358     private static UserGroupPersistence _persistence;
359 }