1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.UserGroup;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="UserGroupUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       UserGroupPersistence
35   * @see       UserGroupPersistenceImpl
36   * @generated
37   */
38  public class UserGroupUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(UserGroup)
48       */
49      public static void clearCache(UserGroup userGroup) {
50          getPersistence().clearCache(userGroup);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static UserGroup remove(UserGroup userGroup)
81          throws SystemException {
82          return getPersistence().remove(userGroup);
83      }
84  
85      /**
86       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
87       */
88      public static UserGroup update(UserGroup userGroup, boolean merge)
89          throws SystemException {
90          return getPersistence().update(userGroup, merge);
91      }
92  
93      public static void cacheResult(com.liferay.portal.model.UserGroup userGroup) {
94          getPersistence().cacheResult(userGroup);
95      }
96  
97      public static void cacheResult(
98          java.util.List<com.liferay.portal.model.UserGroup> userGroups) {
99          getPersistence().cacheResult(userGroups);
100     }
101 
102     public static com.liferay.portal.model.UserGroup create(long userGroupId) {
103         return getPersistence().create(userGroupId);
104     }
105 
106     public static com.liferay.portal.model.UserGroup remove(long userGroupId)
107         throws com.liferay.portal.NoSuchUserGroupException,
108             com.liferay.portal.SystemException {
109         return getPersistence().remove(userGroupId);
110     }
111 
112     /**
113      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
114      */
115     public static com.liferay.portal.model.UserGroup update(
116         com.liferay.portal.model.UserGroup userGroup)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().update(userGroup);
119     }
120 
121     public static com.liferay.portal.model.UserGroup updateImpl(
122         com.liferay.portal.model.UserGroup userGroup, boolean merge)
123         throws com.liferay.portal.SystemException {
124         return getPersistence().updateImpl(userGroup, merge);
125     }
126 
127     public static com.liferay.portal.model.UserGroup findByPrimaryKey(
128         long userGroupId)
129         throws com.liferay.portal.NoSuchUserGroupException,
130             com.liferay.portal.SystemException {
131         return getPersistence().findByPrimaryKey(userGroupId);
132     }
133 
134     public static com.liferay.portal.model.UserGroup fetchByPrimaryKey(
135         long userGroupId) throws com.liferay.portal.SystemException {
136         return getPersistence().fetchByPrimaryKey(userGroupId);
137     }
138 
139     public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
140         long companyId) throws com.liferay.portal.SystemException {
141         return getPersistence().findByCompanyId(companyId);
142     }
143 
144     public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
145         long companyId, int start, int end)
146         throws com.liferay.portal.SystemException {
147         return getPersistence().findByCompanyId(companyId, start, end);
148     }
149 
150     public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
151         long companyId, int start, int end,
152         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
153         throws com.liferay.portal.SystemException {
154         return getPersistence()
155                    .findByCompanyId(companyId, start, end, orderByComparator);
156     }
157 
158     public static com.liferay.portal.model.UserGroup findByCompanyId_First(
159         long companyId,
160         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
161         throws com.liferay.portal.NoSuchUserGroupException,
162             com.liferay.portal.SystemException {
163         return getPersistence()
164                    .findByCompanyId_First(companyId, orderByComparator);
165     }
166 
167     public static com.liferay.portal.model.UserGroup findByCompanyId_Last(
168         long companyId,
169         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
170         throws com.liferay.portal.NoSuchUserGroupException,
171             com.liferay.portal.SystemException {
172         return getPersistence()
173                    .findByCompanyId_Last(companyId, orderByComparator);
174     }
175 
176     public static com.liferay.portal.model.UserGroup[] findByCompanyId_PrevAndNext(
177         long userGroupId, long companyId,
178         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179         throws com.liferay.portal.NoSuchUserGroupException,
180             com.liferay.portal.SystemException {
181         return getPersistence()
182                    .findByCompanyId_PrevAndNext(userGroupId, companyId,
183             orderByComparator);
184     }
185 
186     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
187         long companyId, long parentUserGroupId)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().findByC_P(companyId, parentUserGroupId);
190     }
191 
192     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
193         long companyId, long parentUserGroupId, int start, int end)
194         throws com.liferay.portal.SystemException {
195         return getPersistence()
196                    .findByC_P(companyId, parentUserGroupId, start, end);
197     }
198 
199     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
200         long companyId, long parentUserGroupId, int start, int end,
201         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
202         throws com.liferay.portal.SystemException {
203         return getPersistence()
204                    .findByC_P(companyId, parentUserGroupId, start, end,
205             orderByComparator);
206     }
207 
208     public static com.liferay.portal.model.UserGroup findByC_P_First(
209         long companyId, long parentUserGroupId,
210         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
211         throws com.liferay.portal.NoSuchUserGroupException,
212             com.liferay.portal.SystemException {
213         return getPersistence()
214                    .findByC_P_First(companyId, parentUserGroupId,
215             orderByComparator);
216     }
217 
218     public static com.liferay.portal.model.UserGroup findByC_P_Last(
219         long companyId, long parentUserGroupId,
220         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
221         throws com.liferay.portal.NoSuchUserGroupException,
222             com.liferay.portal.SystemException {
223         return getPersistence()
224                    .findByC_P_Last(companyId, parentUserGroupId,
225             orderByComparator);
226     }
227 
228     public static com.liferay.portal.model.UserGroup[] findByC_P_PrevAndNext(
229         long userGroupId, long companyId, long parentUserGroupId,
230         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
231         throws com.liferay.portal.NoSuchUserGroupException,
232             com.liferay.portal.SystemException {
233         return getPersistence()
234                    .findByC_P_PrevAndNext(userGroupId, companyId,
235             parentUserGroupId, orderByComparator);
236     }
237 
238     public static com.liferay.portal.model.UserGroup findByC_N(long companyId,
239         java.lang.String name)
240         throws com.liferay.portal.NoSuchUserGroupException,
241             com.liferay.portal.SystemException {
242         return getPersistence().findByC_N(companyId, name);
243     }
244 
245     public static com.liferay.portal.model.UserGroup fetchByC_N(
246         long companyId, java.lang.String name)
247         throws com.liferay.portal.SystemException {
248         return getPersistence().fetchByC_N(companyId, name);
249     }
250 
251     public static com.liferay.portal.model.UserGroup fetchByC_N(
252         long companyId, java.lang.String name, boolean retrieveFromCache)
253         throws com.liferay.portal.SystemException {
254         return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
255     }
256 
257     public static java.util.List<com.liferay.portal.model.UserGroup> findAll()
258         throws com.liferay.portal.SystemException {
259         return getPersistence().findAll();
260     }
261 
262     public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
263         int start, int end) throws com.liferay.portal.SystemException {
264         return getPersistence().findAll(start, end);
265     }
266 
267     public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
268         int start, int end,
269         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
270         throws com.liferay.portal.SystemException {
271         return getPersistence().findAll(start, end, orderByComparator);
272     }
273 
274     public static void removeByCompanyId(long companyId)
275         throws com.liferay.portal.SystemException {
276         getPersistence().removeByCompanyId(companyId);
277     }
278 
279     public static void removeByC_P(long companyId, long parentUserGroupId)
280         throws com.liferay.portal.SystemException {
281         getPersistence().removeByC_P(companyId, parentUserGroupId);
282     }
283 
284     public static void removeByC_N(long companyId, java.lang.String name)
285         throws com.liferay.portal.NoSuchUserGroupException,
286             com.liferay.portal.SystemException {
287         getPersistence().removeByC_N(companyId, name);
288     }
289 
290     public static void removeAll() throws com.liferay.portal.SystemException {
291         getPersistence().removeAll();
292     }
293 
294     public static int countByCompanyId(long companyId)
295         throws com.liferay.portal.SystemException {
296         return getPersistence().countByCompanyId(companyId);
297     }
298 
299     public static int countByC_P(long companyId, long parentUserGroupId)
300         throws com.liferay.portal.SystemException {
301         return getPersistence().countByC_P(companyId, parentUserGroupId);
302     }
303 
304     public static int countByC_N(long companyId, java.lang.String name)
305         throws com.liferay.portal.SystemException {
306         return getPersistence().countByC_N(companyId, name);
307     }
308 
309     public static int countAll() throws com.liferay.portal.SystemException {
310         return getPersistence().countAll();
311     }
312 
313     public static java.util.List<com.liferay.portal.model.Group> getGroups(
314         long pk) throws com.liferay.portal.SystemException {
315         return getPersistence().getGroups(pk);
316     }
317 
318     public static java.util.List<com.liferay.portal.model.Group> getGroups(
319         long pk, int start, int end) throws com.liferay.portal.SystemException {
320         return getPersistence().getGroups(pk, start, end);
321     }
322 
323     public static java.util.List<com.liferay.portal.model.Group> getGroups(
324         long pk, int start, int end,
325         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
326         throws com.liferay.portal.SystemException {
327         return getPersistence().getGroups(pk, start, end, orderByComparator);
328     }
329 
330     public static int getGroupsSize(long pk)
331         throws com.liferay.portal.SystemException {
332         return getPersistence().getGroupsSize(pk);
333     }
334 
335     public static boolean containsGroup(long pk, long groupPK)
336         throws com.liferay.portal.SystemException {
337         return getPersistence().containsGroup(pk, groupPK);
338     }
339 
340     public static boolean containsGroups(long pk)
341         throws com.liferay.portal.SystemException {
342         return getPersistence().containsGroups(pk);
343     }
344 
345     public static void addGroup(long pk, long groupPK)
346         throws com.liferay.portal.SystemException {
347         getPersistence().addGroup(pk, groupPK);
348     }
349 
350     public static void addGroup(long pk, com.liferay.portal.model.Group group)
351         throws com.liferay.portal.SystemException {
352         getPersistence().addGroup(pk, group);
353     }
354 
355     public static void addGroups(long pk, long[] groupPKs)
356         throws com.liferay.portal.SystemException {
357         getPersistence().addGroups(pk, groupPKs);
358     }
359 
360     public static void addGroups(long pk,
361         java.util.List<com.liferay.portal.model.Group> groups)
362         throws com.liferay.portal.SystemException {
363         getPersistence().addGroups(pk, groups);
364     }
365 
366     public static void clearGroups(long pk)
367         throws com.liferay.portal.SystemException {
368         getPersistence().clearGroups(pk);
369     }
370 
371     public static void removeGroup(long pk, long groupPK)
372         throws com.liferay.portal.SystemException {
373         getPersistence().removeGroup(pk, groupPK);
374     }
375 
376     public static void removeGroup(long pk, com.liferay.portal.model.Group group)
377         throws com.liferay.portal.SystemException {
378         getPersistence().removeGroup(pk, group);
379     }
380 
381     public static void removeGroups(long pk, long[] groupPKs)
382         throws com.liferay.portal.SystemException {
383         getPersistence().removeGroups(pk, groupPKs);
384     }
385 
386     public static void removeGroups(long pk,
387         java.util.List<com.liferay.portal.model.Group> groups)
388         throws com.liferay.portal.SystemException {
389         getPersistence().removeGroups(pk, groups);
390     }
391 
392     public static void setGroups(long pk, long[] groupPKs)
393         throws com.liferay.portal.SystemException {
394         getPersistence().setGroups(pk, groupPKs);
395     }
396 
397     public static void setGroups(long pk,
398         java.util.List<com.liferay.portal.model.Group> groups)
399         throws com.liferay.portal.SystemException {
400         getPersistence().setGroups(pk, groups);
401     }
402 
403     public static java.util.List<com.liferay.portal.model.User> getUsers(
404         long pk) throws com.liferay.portal.SystemException {
405         return getPersistence().getUsers(pk);
406     }
407 
408     public static java.util.List<com.liferay.portal.model.User> getUsers(
409         long pk, int start, int end) throws com.liferay.portal.SystemException {
410         return getPersistence().getUsers(pk, start, end);
411     }
412 
413     public static java.util.List<com.liferay.portal.model.User> getUsers(
414         long pk, int start, int end,
415         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
416         throws com.liferay.portal.SystemException {
417         return getPersistence().getUsers(pk, start, end, orderByComparator);
418     }
419 
420     public static int getUsersSize(long pk)
421         throws com.liferay.portal.SystemException {
422         return getPersistence().getUsersSize(pk);
423     }
424 
425     public static boolean containsUser(long pk, long userPK)
426         throws com.liferay.portal.SystemException {
427         return getPersistence().containsUser(pk, userPK);
428     }
429 
430     public static boolean containsUsers(long pk)
431         throws com.liferay.portal.SystemException {
432         return getPersistence().containsUsers(pk);
433     }
434 
435     public static void addUser(long pk, long userPK)
436         throws com.liferay.portal.SystemException {
437         getPersistence().addUser(pk, userPK);
438     }
439 
440     public static void addUser(long pk, com.liferay.portal.model.User user)
441         throws com.liferay.portal.SystemException {
442         getPersistence().addUser(pk, user);
443     }
444 
445     public static void addUsers(long pk, long[] userPKs)
446         throws com.liferay.portal.SystemException {
447         getPersistence().addUsers(pk, userPKs);
448     }
449 
450     public static void addUsers(long pk,
451         java.util.List<com.liferay.portal.model.User> users)
452         throws com.liferay.portal.SystemException {
453         getPersistence().addUsers(pk, users);
454     }
455 
456     public static void clearUsers(long pk)
457         throws com.liferay.portal.SystemException {
458         getPersistence().clearUsers(pk);
459     }
460 
461     public static void removeUser(long pk, long userPK)
462         throws com.liferay.portal.SystemException {
463         getPersistence().removeUser(pk, userPK);
464     }
465 
466     public static void removeUser(long pk, com.liferay.portal.model.User user)
467         throws com.liferay.portal.SystemException {
468         getPersistence().removeUser(pk, user);
469     }
470 
471     public static void removeUsers(long pk, long[] userPKs)
472         throws com.liferay.portal.SystemException {
473         getPersistence().removeUsers(pk, userPKs);
474     }
475 
476     public static void removeUsers(long pk,
477         java.util.List<com.liferay.portal.model.User> users)
478         throws com.liferay.portal.SystemException {
479         getPersistence().removeUsers(pk, users);
480     }
481 
482     public static void setUsers(long pk, long[] userPKs)
483         throws com.liferay.portal.SystemException {
484         getPersistence().setUsers(pk, userPKs);
485     }
486 
487     public static void setUsers(long pk,
488         java.util.List<com.liferay.portal.model.User> users)
489         throws com.liferay.portal.SystemException {
490         getPersistence().setUsers(pk, users);
491     }
492 
493     public static UserGroupPersistence getPersistence() {
494         if (_persistence == null) {
495             _persistence = (UserGroupPersistence)PortalBeanLocatorUtil.locate(UserGroupPersistence.class.getName());
496 
497             ReferenceRegistry.registerReference(UserGroupUtil.class,
498                 "_persistence");
499         }
500 
501         return _persistence;
502     }
503 
504     public void setPersistence(UserGroupPersistence persistence) {
505         _persistence = persistence;
506 
507         ReferenceRegistry.registerReference(UserGroupUtil.class, "_persistence");
508     }
509 
510     private static UserGroupPersistence _persistence;
511 }