001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.UserGroup;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the user group service. This utility wraps {@link UserGroupPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see UserGroupPersistence
036     * @see UserGroupPersistenceImpl
037     * @generated
038     */
039    public class UserGroupUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(UserGroup userGroup) {
057                    getPersistence().clearCache(userGroup);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<UserGroup> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<UserGroup> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<UserGroup> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
098             */
099            public static UserGroup remove(UserGroup userGroup)
100                    throws SystemException {
101                    return getPersistence().remove(userGroup);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
106             */
107            public static UserGroup update(UserGroup userGroup, boolean merge)
108                    throws SystemException {
109                    return getPersistence().update(userGroup, merge);
110            }
111    
112            /**
113             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
114             */
115            public static UserGroup update(UserGroup userGroup, boolean merge,
116                    ServiceContext serviceContext) throws SystemException {
117                    return getPersistence().update(userGroup, merge, serviceContext);
118            }
119    
120            /**
121            * Caches the user group in the entity cache if it is enabled.
122            *
123            * @param userGroup the user group to cache
124            */
125            public static void cacheResult(com.liferay.portal.model.UserGroup userGroup) {
126                    getPersistence().cacheResult(userGroup);
127            }
128    
129            /**
130            * Caches the user groups in the entity cache if it is enabled.
131            *
132            * @param userGroups the user groups to cache
133            */
134            public static void cacheResult(
135                    java.util.List<com.liferay.portal.model.UserGroup> userGroups) {
136                    getPersistence().cacheResult(userGroups);
137            }
138    
139            /**
140            * Creates a new user group with the primary key. Does not add the user group to the database.
141            *
142            * @param userGroupId the primary key for the new user group
143            * @return the new user group
144            */
145            public static com.liferay.portal.model.UserGroup create(long userGroupId) {
146                    return getPersistence().create(userGroupId);
147            }
148    
149            /**
150            * Removes the user group with the primary key from the database. Also notifies the appropriate model listeners.
151            *
152            * @param userGroupId the primary key of the user group to remove
153            * @return the user group that was removed
154            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
155            * @throws SystemException if a system exception occurred
156            */
157            public static com.liferay.portal.model.UserGroup remove(long userGroupId)
158                    throws com.liferay.portal.NoSuchUserGroupException,
159                            com.liferay.portal.kernel.exception.SystemException {
160                    return getPersistence().remove(userGroupId);
161            }
162    
163            public static com.liferay.portal.model.UserGroup updateImpl(
164                    com.liferay.portal.model.UserGroup userGroup, boolean merge)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence().updateImpl(userGroup, merge);
167            }
168    
169            /**
170            * Finds the user group with the primary key or throws a {@link com.liferay.portal.NoSuchUserGroupException} if it could not be found.
171            *
172            * @param userGroupId the primary key of the user group to find
173            * @return the user group
174            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portal.model.UserGroup findByPrimaryKey(
178                    long userGroupId)
179                    throws com.liferay.portal.NoSuchUserGroupException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getPersistence().findByPrimaryKey(userGroupId);
182            }
183    
184            /**
185            * Finds the user group with the primary key or returns <code>null</code> if it could not be found.
186            *
187            * @param userGroupId the primary key of the user group to find
188            * @return the user group, or <code>null</code> if a user group with the primary key could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public static com.liferay.portal.model.UserGroup fetchByPrimaryKey(
192                    long userGroupId)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByPrimaryKey(userGroupId);
195            }
196    
197            /**
198            * Finds all the user groups where companyId = &#63;.
199            *
200            * @param companyId the company ID to search with
201            * @return the matching user groups
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
205                    long companyId)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    return getPersistence().findByCompanyId(companyId);
208            }
209    
210            /**
211            * Finds a range of all the user groups where companyId = &#63;.
212            *
213            * <p>
214            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
215            * </p>
216            *
217            * @param companyId the company ID to search with
218            * @param start the lower bound of the range of user groups to return
219            * @param end the upper bound of the range of user groups to return (not inclusive)
220            * @return the range of matching user groups
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
224                    long companyId, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().findByCompanyId(companyId, start, end);
227            }
228    
229            /**
230            * Finds an ordered range of all the user groups where companyId = &#63;.
231            *
232            * <p>
233            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
234            * </p>
235            *
236            * @param companyId the company ID to search with
237            * @param start the lower bound of the range of user groups to return
238            * @param end the upper bound of the range of user groups to return (not inclusive)
239            * @param orderByComparator the comparator to order the results by
240            * @return the ordered range of matching user groups
241            * @throws SystemException if a system exception occurred
242            */
243            public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
244                    long companyId, int start, int end,
245                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
246                    throws com.liferay.portal.kernel.exception.SystemException {
247                    return getPersistence()
248                                       .findByCompanyId(companyId, start, end, orderByComparator);
249            }
250    
251            /**
252            * Finds the first user group in the ordered set where companyId = &#63;.
253            *
254            * <p>
255            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
256            * </p>
257            *
258            * @param companyId the company ID to search with
259            * @param orderByComparator the comparator to order the set by
260            * @return the first matching user group
261            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
262            * @throws SystemException if a system exception occurred
263            */
264            public static com.liferay.portal.model.UserGroup findByCompanyId_First(
265                    long companyId,
266                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
267                    throws com.liferay.portal.NoSuchUserGroupException,
268                            com.liferay.portal.kernel.exception.SystemException {
269                    return getPersistence()
270                                       .findByCompanyId_First(companyId, orderByComparator);
271            }
272    
273            /**
274            * Finds the last user group in the ordered set where companyId = &#63;.
275            *
276            * <p>
277            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
278            * </p>
279            *
280            * @param companyId the company ID to search with
281            * @param orderByComparator the comparator to order the set by
282            * @return the last matching user group
283            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
284            * @throws SystemException if a system exception occurred
285            */
286            public static com.liferay.portal.model.UserGroup findByCompanyId_Last(
287                    long companyId,
288                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
289                    throws com.liferay.portal.NoSuchUserGroupException,
290                            com.liferay.portal.kernel.exception.SystemException {
291                    return getPersistence()
292                                       .findByCompanyId_Last(companyId, orderByComparator);
293            }
294    
295            /**
296            * Finds the user groups before and after the current user group in the ordered set where companyId = &#63;.
297            *
298            * <p>
299            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
300            * </p>
301            *
302            * @param userGroupId the primary key of the current user group
303            * @param companyId the company ID to search with
304            * @param orderByComparator the comparator to order the set by
305            * @return the previous, current, and next user group
306            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
307            * @throws SystemException if a system exception occurred
308            */
309            public static com.liferay.portal.model.UserGroup[] findByCompanyId_PrevAndNext(
310                    long userGroupId, long companyId,
311                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
312                    throws com.liferay.portal.NoSuchUserGroupException,
313                            com.liferay.portal.kernel.exception.SystemException {
314                    return getPersistence()
315                                       .findByCompanyId_PrevAndNext(userGroupId, companyId,
316                            orderByComparator);
317            }
318    
319            /**
320            * Filters by the user's permissions and finds all the user groups where companyId = &#63;.
321            *
322            * @param companyId the company ID to search with
323            * @return the matching user groups that the user has permission to view
324            * @throws SystemException if a system exception occurred
325            */
326            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByCompanyId(
327                    long companyId)
328                    throws com.liferay.portal.kernel.exception.SystemException {
329                    return getPersistence().filterFindByCompanyId(companyId);
330            }
331    
332            /**
333            * Filters by the user's permissions and finds a range of all the user groups where companyId = &#63;.
334            *
335            * <p>
336            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
337            * </p>
338            *
339            * @param companyId the company ID to search with
340            * @param start the lower bound of the range of user groups to return
341            * @param end the upper bound of the range of user groups to return (not inclusive)
342            * @return the range of matching user groups that the user has permission to view
343            * @throws SystemException if a system exception occurred
344            */
345            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByCompanyId(
346                    long companyId, int start, int end)
347                    throws com.liferay.portal.kernel.exception.SystemException {
348                    return getPersistence().filterFindByCompanyId(companyId, start, end);
349            }
350    
351            /**
352            * Filters by the user's permissions and finds an ordered range of all the user groups where companyId = &#63;.
353            *
354            * <p>
355            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
356            * </p>
357            *
358            * @param companyId the company ID to search with
359            * @param start the lower bound of the range of user groups to return
360            * @param end the upper bound of the range of user groups to return (not inclusive)
361            * @param orderByComparator the comparator to order the results by
362            * @return the ordered range of matching user groups that the user has permission to view
363            * @throws SystemException if a system exception occurred
364            */
365            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByCompanyId(
366                    long companyId, int start, int end,
367                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    return getPersistence()
370                                       .filterFindByCompanyId(companyId, start, end,
371                            orderByComparator);
372            }
373    
374            /**
375            * Filters the user groups before and after the current user group in the ordered set where companyId = &#63;.
376            *
377            * <p>
378            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
379            * </p>
380            *
381            * @param userGroupId the primary key of the current user group
382            * @param companyId the company ID to search with
383            * @param orderByComparator the comparator to order the set by
384            * @return the previous, current, and next user group
385            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
386            * @throws SystemException if a system exception occurred
387            */
388            public static com.liferay.portal.model.UserGroup[] filterFindByCompanyId_PrevAndNext(
389                    long userGroupId, long companyId,
390                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
391                    throws com.liferay.portal.NoSuchUserGroupException,
392                            com.liferay.portal.kernel.exception.SystemException {
393                    return getPersistence()
394                                       .filterFindByCompanyId_PrevAndNext(userGroupId, companyId,
395                            orderByComparator);
396            }
397    
398            /**
399            * Finds all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
400            *
401            * @param companyId the company ID to search with
402            * @param parentUserGroupId the parent user group ID to search with
403            * @return the matching user groups
404            * @throws SystemException if a system exception occurred
405            */
406            public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
407                    long companyId, long parentUserGroupId)
408                    throws com.liferay.portal.kernel.exception.SystemException {
409                    return getPersistence().findByC_P(companyId, parentUserGroupId);
410            }
411    
412            /**
413            * Finds a range of all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
414            *
415            * <p>
416            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
417            * </p>
418            *
419            * @param companyId the company ID to search with
420            * @param parentUserGroupId the parent user group ID to search with
421            * @param start the lower bound of the range of user groups to return
422            * @param end the upper bound of the range of user groups to return (not inclusive)
423            * @return the range of matching user groups
424            * @throws SystemException if a system exception occurred
425            */
426            public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
427                    long companyId, long parentUserGroupId, int start, int end)
428                    throws com.liferay.portal.kernel.exception.SystemException {
429                    return getPersistence()
430                                       .findByC_P(companyId, parentUserGroupId, start, end);
431            }
432    
433            /**
434            * Finds an ordered range of all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
435            *
436            * <p>
437            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
438            * </p>
439            *
440            * @param companyId the company ID to search with
441            * @param parentUserGroupId the parent user group ID to search with
442            * @param start the lower bound of the range of user groups to return
443            * @param end the upper bound of the range of user groups to return (not inclusive)
444            * @param orderByComparator the comparator to order the results by
445            * @return the ordered range of matching user groups
446            * @throws SystemException if a system exception occurred
447            */
448            public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
449                    long companyId, long parentUserGroupId, int start, int end,
450                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
451                    throws com.liferay.portal.kernel.exception.SystemException {
452                    return getPersistence()
453                                       .findByC_P(companyId, parentUserGroupId, start, end,
454                            orderByComparator);
455            }
456    
457            /**
458            * Finds the first user group in the ordered set where companyId = &#63; and parentUserGroupId = &#63;.
459            *
460            * <p>
461            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
462            * </p>
463            *
464            * @param companyId the company ID to search with
465            * @param parentUserGroupId the parent user group ID to search with
466            * @param orderByComparator the comparator to order the set by
467            * @return the first matching user group
468            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
469            * @throws SystemException if a system exception occurred
470            */
471            public static com.liferay.portal.model.UserGroup findByC_P_First(
472                    long companyId, long parentUserGroupId,
473                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
474                    throws com.liferay.portal.NoSuchUserGroupException,
475                            com.liferay.portal.kernel.exception.SystemException {
476                    return getPersistence()
477                                       .findByC_P_First(companyId, parentUserGroupId,
478                            orderByComparator);
479            }
480    
481            /**
482            * Finds the last user group in the ordered set where companyId = &#63; and parentUserGroupId = &#63;.
483            *
484            * <p>
485            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
486            * </p>
487            *
488            * @param companyId the company ID to search with
489            * @param parentUserGroupId the parent user group ID to search with
490            * @param orderByComparator the comparator to order the set by
491            * @return the last matching user group
492            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
493            * @throws SystemException if a system exception occurred
494            */
495            public static com.liferay.portal.model.UserGroup findByC_P_Last(
496                    long companyId, long parentUserGroupId,
497                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
498                    throws com.liferay.portal.NoSuchUserGroupException,
499                            com.liferay.portal.kernel.exception.SystemException {
500                    return getPersistence()
501                                       .findByC_P_Last(companyId, parentUserGroupId,
502                            orderByComparator);
503            }
504    
505            /**
506            * Finds the user groups before and after the current user group in the ordered set where companyId = &#63; and parentUserGroupId = &#63;.
507            *
508            * <p>
509            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
510            * </p>
511            *
512            * @param userGroupId the primary key of the current user group
513            * @param companyId the company ID to search with
514            * @param parentUserGroupId the parent user group ID to search with
515            * @param orderByComparator the comparator to order the set by
516            * @return the previous, current, and next user group
517            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
518            * @throws SystemException if a system exception occurred
519            */
520            public static com.liferay.portal.model.UserGroup[] findByC_P_PrevAndNext(
521                    long userGroupId, long companyId, long parentUserGroupId,
522                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
523                    throws com.liferay.portal.NoSuchUserGroupException,
524                            com.liferay.portal.kernel.exception.SystemException {
525                    return getPersistence()
526                                       .findByC_P_PrevAndNext(userGroupId, companyId,
527                            parentUserGroupId, orderByComparator);
528            }
529    
530            /**
531            * Filters by the user's permissions and finds all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
532            *
533            * @param companyId the company ID to search with
534            * @param parentUserGroupId the parent user group ID to search with
535            * @return the matching user groups that the user has permission to view
536            * @throws SystemException if a system exception occurred
537            */
538            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByC_P(
539                    long companyId, long parentUserGroupId)
540                    throws com.liferay.portal.kernel.exception.SystemException {
541                    return getPersistence().filterFindByC_P(companyId, parentUserGroupId);
542            }
543    
544            /**
545            * Filters by the user's permissions and finds a range of all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
546            *
547            * <p>
548            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
549            * </p>
550            *
551            * @param companyId the company ID to search with
552            * @param parentUserGroupId the parent user group ID to search with
553            * @param start the lower bound of the range of user groups to return
554            * @param end the upper bound of the range of user groups to return (not inclusive)
555            * @return the range of matching user groups that the user has permission to view
556            * @throws SystemException if a system exception occurred
557            */
558            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByC_P(
559                    long companyId, long parentUserGroupId, int start, int end)
560                    throws com.liferay.portal.kernel.exception.SystemException {
561                    return getPersistence()
562                                       .filterFindByC_P(companyId, parentUserGroupId, start, end);
563            }
564    
565            /**
566            * Filters by the user's permissions and finds an ordered range of all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
567            *
568            * <p>
569            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
570            * </p>
571            *
572            * @param companyId the company ID to search with
573            * @param parentUserGroupId the parent user group ID to search with
574            * @param start the lower bound of the range of user groups to return
575            * @param end the upper bound of the range of user groups to return (not inclusive)
576            * @param orderByComparator the comparator to order the results by
577            * @return the ordered range of matching user groups that the user has permission to view
578            * @throws SystemException if a system exception occurred
579            */
580            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByC_P(
581                    long companyId, long parentUserGroupId, int start, int end,
582                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
583                    throws com.liferay.portal.kernel.exception.SystemException {
584                    return getPersistence()
585                                       .filterFindByC_P(companyId, parentUserGroupId, start, end,
586                            orderByComparator);
587            }
588    
589            /**
590            * Filters the user groups before and after the current user group in the ordered set where companyId = &#63; and parentUserGroupId = &#63;.
591            *
592            * <p>
593            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
594            * </p>
595            *
596            * @param userGroupId the primary key of the current user group
597            * @param companyId the company ID to search with
598            * @param parentUserGroupId the parent user group ID to search with
599            * @param orderByComparator the comparator to order the set by
600            * @return the previous, current, and next user group
601            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
602            * @throws SystemException if a system exception occurred
603            */
604            public static com.liferay.portal.model.UserGroup[] filterFindByC_P_PrevAndNext(
605                    long userGroupId, long companyId, long parentUserGroupId,
606                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
607                    throws com.liferay.portal.NoSuchUserGroupException,
608                            com.liferay.portal.kernel.exception.SystemException {
609                    return getPersistence()
610                                       .filterFindByC_P_PrevAndNext(userGroupId, companyId,
611                            parentUserGroupId, orderByComparator);
612            }
613    
614            /**
615            * Finds the user group where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchUserGroupException} if it could not be found.
616            *
617            * @param companyId the company ID to search with
618            * @param name the name to search with
619            * @return the matching user group
620            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
621            * @throws SystemException if a system exception occurred
622            */
623            public static com.liferay.portal.model.UserGroup findByC_N(long companyId,
624                    java.lang.String name)
625                    throws com.liferay.portal.NoSuchUserGroupException,
626                            com.liferay.portal.kernel.exception.SystemException {
627                    return getPersistence().findByC_N(companyId, name);
628            }
629    
630            /**
631            * Finds the user group where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
632            *
633            * @param companyId the company ID to search with
634            * @param name the name to search with
635            * @return the matching user group, or <code>null</code> if a matching user group could not be found
636            * @throws SystemException if a system exception occurred
637            */
638            public static com.liferay.portal.model.UserGroup fetchByC_N(
639                    long companyId, java.lang.String name)
640                    throws com.liferay.portal.kernel.exception.SystemException {
641                    return getPersistence().fetchByC_N(companyId, name);
642            }
643    
644            /**
645            * Finds the user group where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
646            *
647            * @param companyId the company ID to search with
648            * @param name the name to search with
649            * @return the matching user group, or <code>null</code> if a matching user group could not be found
650            * @throws SystemException if a system exception occurred
651            */
652            public static com.liferay.portal.model.UserGroup fetchByC_N(
653                    long companyId, java.lang.String name, boolean retrieveFromCache)
654                    throws com.liferay.portal.kernel.exception.SystemException {
655                    return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
656            }
657    
658            /**
659            * Finds all the user groups.
660            *
661            * @return the user groups
662            * @throws SystemException if a system exception occurred
663            */
664            public static java.util.List<com.liferay.portal.model.UserGroup> findAll()
665                    throws com.liferay.portal.kernel.exception.SystemException {
666                    return getPersistence().findAll();
667            }
668    
669            /**
670            * Finds a range of all the user groups.
671            *
672            * <p>
673            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
674            * </p>
675            *
676            * @param start the lower bound of the range of user groups to return
677            * @param end the upper bound of the range of user groups to return (not inclusive)
678            * @return the range of user groups
679            * @throws SystemException if a system exception occurred
680            */
681            public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
682                    int start, int end)
683                    throws com.liferay.portal.kernel.exception.SystemException {
684                    return getPersistence().findAll(start, end);
685            }
686    
687            /**
688            * Finds an ordered range of all the user groups.
689            *
690            * <p>
691            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
692            * </p>
693            *
694            * @param start the lower bound of the range of user groups to return
695            * @param end the upper bound of the range of user groups to return (not inclusive)
696            * @param orderByComparator the comparator to order the results by
697            * @return the ordered range of user groups
698            * @throws SystemException if a system exception occurred
699            */
700            public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
701                    int start, int end,
702                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
703                    throws com.liferay.portal.kernel.exception.SystemException {
704                    return getPersistence().findAll(start, end, orderByComparator);
705            }
706    
707            /**
708            * Removes all the user groups where companyId = &#63; from the database.
709            *
710            * @param companyId the company ID to search with
711            * @throws SystemException if a system exception occurred
712            */
713            public static void removeByCompanyId(long companyId)
714                    throws com.liferay.portal.kernel.exception.SystemException {
715                    getPersistence().removeByCompanyId(companyId);
716            }
717    
718            /**
719            * Removes all the user groups where companyId = &#63; and parentUserGroupId = &#63; from the database.
720            *
721            * @param companyId the company ID to search with
722            * @param parentUserGroupId the parent user group ID to search with
723            * @throws SystemException if a system exception occurred
724            */
725            public static void removeByC_P(long companyId, long parentUserGroupId)
726                    throws com.liferay.portal.kernel.exception.SystemException {
727                    getPersistence().removeByC_P(companyId, parentUserGroupId);
728            }
729    
730            /**
731            * Removes the user group where companyId = &#63; and name = &#63; from the database.
732            *
733            * @param companyId the company ID to search with
734            * @param name the name to search with
735            * @throws SystemException if a system exception occurred
736            */
737            public static void removeByC_N(long companyId, java.lang.String name)
738                    throws com.liferay.portal.NoSuchUserGroupException,
739                            com.liferay.portal.kernel.exception.SystemException {
740                    getPersistence().removeByC_N(companyId, name);
741            }
742    
743            /**
744            * Removes all the user groups from the database.
745            *
746            * @throws SystemException if a system exception occurred
747            */
748            public static void removeAll()
749                    throws com.liferay.portal.kernel.exception.SystemException {
750                    getPersistence().removeAll();
751            }
752    
753            /**
754            * Counts all the user groups where companyId = &#63;.
755            *
756            * @param companyId the company ID to search with
757            * @return the number of matching user groups
758            * @throws SystemException if a system exception occurred
759            */
760            public static int countByCompanyId(long companyId)
761                    throws com.liferay.portal.kernel.exception.SystemException {
762                    return getPersistence().countByCompanyId(companyId);
763            }
764    
765            /**
766            * Filters by the user's permissions and counts all the user groups where companyId = &#63;.
767            *
768            * @param companyId the company ID to search with
769            * @return the number of matching user groups that the user has permission to view
770            * @throws SystemException if a system exception occurred
771            */
772            public static int filterCountByCompanyId(long companyId)
773                    throws com.liferay.portal.kernel.exception.SystemException {
774                    return getPersistence().filterCountByCompanyId(companyId);
775            }
776    
777            /**
778            * Counts all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
779            *
780            * @param companyId the company ID to search with
781            * @param parentUserGroupId the parent user group ID to search with
782            * @return the number of matching user groups
783            * @throws SystemException if a system exception occurred
784            */
785            public static int countByC_P(long companyId, long parentUserGroupId)
786                    throws com.liferay.portal.kernel.exception.SystemException {
787                    return getPersistence().countByC_P(companyId, parentUserGroupId);
788            }
789    
790            /**
791            * Filters by the user's permissions and counts all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
792            *
793            * @param companyId the company ID to search with
794            * @param parentUserGroupId the parent user group ID to search with
795            * @return the number of matching user groups that the user has permission to view
796            * @throws SystemException if a system exception occurred
797            */
798            public static int filterCountByC_P(long companyId, long parentUserGroupId)
799                    throws com.liferay.portal.kernel.exception.SystemException {
800                    return getPersistence().filterCountByC_P(companyId, parentUserGroupId);
801            }
802    
803            /**
804            * Counts all the user groups where companyId = &#63; and name = &#63;.
805            *
806            * @param companyId the company ID to search with
807            * @param name the name to search with
808            * @return the number of matching user groups
809            * @throws SystemException if a system exception occurred
810            */
811            public static int countByC_N(long companyId, java.lang.String name)
812                    throws com.liferay.portal.kernel.exception.SystemException {
813                    return getPersistence().countByC_N(companyId, name);
814            }
815    
816            /**
817            * Counts all the user groups.
818            *
819            * @return the number of user groups
820            * @throws SystemException if a system exception occurred
821            */
822            public static int countAll()
823                    throws com.liferay.portal.kernel.exception.SystemException {
824                    return getPersistence().countAll();
825            }
826    
827            /**
828            * Gets all the groups associated with the user group.
829            *
830            * @param pk the primary key of the user group to get the associated groups for
831            * @return the groups associated with the user group
832            * @throws SystemException if a system exception occurred
833            */
834            public static java.util.List<com.liferay.portal.model.Group> getGroups(
835                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
836                    return getPersistence().getGroups(pk);
837            }
838    
839            /**
840            * Gets a range of all the groups associated with the user group.
841            *
842            * <p>
843            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
844            * </p>
845            *
846            * @param pk the primary key of the user group to get the associated groups for
847            * @param start the lower bound of the range of user groups to return
848            * @param end the upper bound of the range of user groups to return (not inclusive)
849            * @return the range of groups associated with the user group
850            * @throws SystemException if a system exception occurred
851            */
852            public static java.util.List<com.liferay.portal.model.Group> getGroups(
853                    long pk, int start, int end)
854                    throws com.liferay.portal.kernel.exception.SystemException {
855                    return getPersistence().getGroups(pk, start, end);
856            }
857    
858            /**
859            * Gets an ordered range of all the groups associated with the user group.
860            *
861            * <p>
862            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
863            * </p>
864            *
865            * @param pk the primary key of the user group to get the associated groups for
866            * @param start the lower bound of the range of user groups to return
867            * @param end the upper bound of the range of user groups to return (not inclusive)
868            * @param orderByComparator the comparator to order the results by
869            * @return the ordered range of groups associated with the user group
870            * @throws SystemException if a system exception occurred
871            */
872            public static java.util.List<com.liferay.portal.model.Group> getGroups(
873                    long pk, int start, int end,
874                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
875                    throws com.liferay.portal.kernel.exception.SystemException {
876                    return getPersistence().getGroups(pk, start, end, orderByComparator);
877            }
878    
879            /**
880            * Gets the number of groups associated with the user group.
881            *
882            * @param pk the primary key of the user group to get the number of associated groups for
883            * @return the number of groups associated with the user group
884            * @throws SystemException if a system exception occurred
885            */
886            public static int getGroupsSize(long pk)
887                    throws com.liferay.portal.kernel.exception.SystemException {
888                    return getPersistence().getGroupsSize(pk);
889            }
890    
891            /**
892            * Determines if the group is associated with the user group.
893            *
894            * @param pk the primary key of the user group
895            * @param groupPK the primary key of the group
896            * @return <code>true</code> if the group is associated with the user group; <code>false</code> otherwise
897            * @throws SystemException if a system exception occurred
898            */
899            public static boolean containsGroup(long pk, long groupPK)
900                    throws com.liferay.portal.kernel.exception.SystemException {
901                    return getPersistence().containsGroup(pk, groupPK);
902            }
903    
904            /**
905            * Determines if the user group has any groups associated with it.
906            *
907            * @param pk the primary key of the user group to check for associations with groups
908            * @return <code>true</code> if the user group has any groups associated with it; <code>false</code> otherwise
909            * @throws SystemException if a system exception occurred
910            */
911            public static boolean containsGroups(long pk)
912                    throws com.liferay.portal.kernel.exception.SystemException {
913                    return getPersistence().containsGroups(pk);
914            }
915    
916            /**
917            * Adds an association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
918            *
919            * @param pk the primary key of the user group
920            * @param groupPK the primary key of the group
921            * @throws SystemException if a system exception occurred
922            */
923            public static void addGroup(long pk, long groupPK)
924                    throws com.liferay.portal.kernel.exception.SystemException {
925                    getPersistence().addGroup(pk, groupPK);
926            }
927    
928            /**
929            * Adds an association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
930            *
931            * @param pk the primary key of the user group
932            * @param group the group
933            * @throws SystemException if a system exception occurred
934            */
935            public static void addGroup(long pk, com.liferay.portal.model.Group group)
936                    throws com.liferay.portal.kernel.exception.SystemException {
937                    getPersistence().addGroup(pk, group);
938            }
939    
940            /**
941            * Adds an association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
942            *
943            * @param pk the primary key of the user group
944            * @param groupPKs the primary keys of the groups
945            * @throws SystemException if a system exception occurred
946            */
947            public static void addGroups(long pk, long[] groupPKs)
948                    throws com.liferay.portal.kernel.exception.SystemException {
949                    getPersistence().addGroups(pk, groupPKs);
950            }
951    
952            /**
953            * Adds an association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
954            *
955            * @param pk the primary key of the user group
956            * @param groups the groups
957            * @throws SystemException if a system exception occurred
958            */
959            public static void addGroups(long pk,
960                    java.util.List<com.liferay.portal.model.Group> groups)
961                    throws com.liferay.portal.kernel.exception.SystemException {
962                    getPersistence().addGroups(pk, groups);
963            }
964    
965            /**
966            * Clears all associations between the user group and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
967            *
968            * @param pk the primary key of the user group to clear the associated groups from
969            * @throws SystemException if a system exception occurred
970            */
971            public static void clearGroups(long pk)
972                    throws com.liferay.portal.kernel.exception.SystemException {
973                    getPersistence().clearGroups(pk);
974            }
975    
976            /**
977            * Removes the association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
978            *
979            * @param pk the primary key of the user group
980            * @param groupPK the primary key of the group
981            * @throws SystemException if a system exception occurred
982            */
983            public static void removeGroup(long pk, long groupPK)
984                    throws com.liferay.portal.kernel.exception.SystemException {
985                    getPersistence().removeGroup(pk, groupPK);
986            }
987    
988            /**
989            * Removes the association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
990            *
991            * @param pk the primary key of the user group
992            * @param group the group
993            * @throws SystemException if a system exception occurred
994            */
995            public static void removeGroup(long pk, com.liferay.portal.model.Group group)
996                    throws com.liferay.portal.kernel.exception.SystemException {
997                    getPersistence().removeGroup(pk, group);
998            }
999    
1000            /**
1001            * Removes the association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1002            *
1003            * @param pk the primary key of the user group
1004            * @param groupPKs the primary keys of the groups
1005            * @throws SystemException if a system exception occurred
1006            */
1007            public static void removeGroups(long pk, long[] groupPKs)
1008                    throws com.liferay.portal.kernel.exception.SystemException {
1009                    getPersistence().removeGroups(pk, groupPKs);
1010            }
1011    
1012            /**
1013            * Removes the association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1014            *
1015            * @param pk the primary key of the user group
1016            * @param groups the groups
1017            * @throws SystemException if a system exception occurred
1018            */
1019            public static void removeGroups(long pk,
1020                    java.util.List<com.liferay.portal.model.Group> groups)
1021                    throws com.liferay.portal.kernel.exception.SystemException {
1022                    getPersistence().removeGroups(pk, groups);
1023            }
1024    
1025            /**
1026            * Sets the groups associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1027            *
1028            * @param pk the primary key of the user group to set the associations for
1029            * @param groupPKs the primary keys of the groups to be associated with the user group
1030            * @throws SystemException if a system exception occurred
1031            */
1032            public static void setGroups(long pk, long[] groupPKs)
1033                    throws com.liferay.portal.kernel.exception.SystemException {
1034                    getPersistence().setGroups(pk, groupPKs);
1035            }
1036    
1037            /**
1038            * Sets the groups associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1039            *
1040            * @param pk the primary key of the user group to set the associations for
1041            * @param groups the groups to be associated with the user group
1042            * @throws SystemException if a system exception occurred
1043            */
1044            public static void setGroups(long pk,
1045                    java.util.List<com.liferay.portal.model.Group> groups)
1046                    throws com.liferay.portal.kernel.exception.SystemException {
1047                    getPersistence().setGroups(pk, groups);
1048            }
1049    
1050            /**
1051            * Gets all the teams associated with the user group.
1052            *
1053            * @param pk the primary key of the user group to get the associated teams for
1054            * @return the teams associated with the user group
1055            * @throws SystemException if a system exception occurred
1056            */
1057            public static java.util.List<com.liferay.portal.model.Team> getTeams(
1058                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1059                    return getPersistence().getTeams(pk);
1060            }
1061    
1062            /**
1063            * Gets a range of all the teams associated with the user group.
1064            *
1065            * <p>
1066            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1067            * </p>
1068            *
1069            * @param pk the primary key of the user group to get the associated teams for
1070            * @param start the lower bound of the range of user groups to return
1071            * @param end the upper bound of the range of user groups to return (not inclusive)
1072            * @return the range of teams associated with the user group
1073            * @throws SystemException if a system exception occurred
1074            */
1075            public static java.util.List<com.liferay.portal.model.Team> getTeams(
1076                    long pk, int start, int end)
1077                    throws com.liferay.portal.kernel.exception.SystemException {
1078                    return getPersistence().getTeams(pk, start, end);
1079            }
1080    
1081            /**
1082            * Gets an ordered range of all the teams associated with the user group.
1083            *
1084            * <p>
1085            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1086            * </p>
1087            *
1088            * @param pk the primary key of the user group to get the associated teams for
1089            * @param start the lower bound of the range of user groups to return
1090            * @param end the upper bound of the range of user groups to return (not inclusive)
1091            * @param orderByComparator the comparator to order the results by
1092            * @return the ordered range of teams associated with the user group
1093            * @throws SystemException if a system exception occurred
1094            */
1095            public static java.util.List<com.liferay.portal.model.Team> getTeams(
1096                    long pk, int start, int end,
1097                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1098                    throws com.liferay.portal.kernel.exception.SystemException {
1099                    return getPersistence().getTeams(pk, start, end, orderByComparator);
1100            }
1101    
1102            /**
1103            * Gets the number of teams associated with the user group.
1104            *
1105            * @param pk the primary key of the user group to get the number of associated teams for
1106            * @return the number of teams associated with the user group
1107            * @throws SystemException if a system exception occurred
1108            */
1109            public static int getTeamsSize(long pk)
1110                    throws com.liferay.portal.kernel.exception.SystemException {
1111                    return getPersistence().getTeamsSize(pk);
1112            }
1113    
1114            /**
1115            * Determines if the team is associated with the user group.
1116            *
1117            * @param pk the primary key of the user group
1118            * @param teamPK the primary key of the team
1119            * @return <code>true</code> if the team is associated with the user group; <code>false</code> otherwise
1120            * @throws SystemException if a system exception occurred
1121            */
1122            public static boolean containsTeam(long pk, long teamPK)
1123                    throws com.liferay.portal.kernel.exception.SystemException {
1124                    return getPersistence().containsTeam(pk, teamPK);
1125            }
1126    
1127            /**
1128            * Determines if the user group has any teams associated with it.
1129            *
1130            * @param pk the primary key of the user group to check for associations with teams
1131            * @return <code>true</code> if the user group has any teams associated with it; <code>false</code> otherwise
1132            * @throws SystemException if a system exception occurred
1133            */
1134            public static boolean containsTeams(long pk)
1135                    throws com.liferay.portal.kernel.exception.SystemException {
1136                    return getPersistence().containsTeams(pk);
1137            }
1138    
1139            /**
1140            * Adds an association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1141            *
1142            * @param pk the primary key of the user group
1143            * @param teamPK the primary key of the team
1144            * @throws SystemException if a system exception occurred
1145            */
1146            public static void addTeam(long pk, long teamPK)
1147                    throws com.liferay.portal.kernel.exception.SystemException {
1148                    getPersistence().addTeam(pk, teamPK);
1149            }
1150    
1151            /**
1152            * Adds an association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1153            *
1154            * @param pk the primary key of the user group
1155            * @param team the team
1156            * @throws SystemException if a system exception occurred
1157            */
1158            public static void addTeam(long pk, com.liferay.portal.model.Team team)
1159                    throws com.liferay.portal.kernel.exception.SystemException {
1160                    getPersistence().addTeam(pk, team);
1161            }
1162    
1163            /**
1164            * Adds an association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1165            *
1166            * @param pk the primary key of the user group
1167            * @param teamPKs the primary keys of the teams
1168            * @throws SystemException if a system exception occurred
1169            */
1170            public static void addTeams(long pk, long[] teamPKs)
1171                    throws com.liferay.portal.kernel.exception.SystemException {
1172                    getPersistence().addTeams(pk, teamPKs);
1173            }
1174    
1175            /**
1176            * Adds an association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1177            *
1178            * @param pk the primary key of the user group
1179            * @param teams the teams
1180            * @throws SystemException if a system exception occurred
1181            */
1182            public static void addTeams(long pk,
1183                    java.util.List<com.liferay.portal.model.Team> teams)
1184                    throws com.liferay.portal.kernel.exception.SystemException {
1185                    getPersistence().addTeams(pk, teams);
1186            }
1187    
1188            /**
1189            * Clears all associations between the user group and its teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1190            *
1191            * @param pk the primary key of the user group to clear the associated teams from
1192            * @throws SystemException if a system exception occurred
1193            */
1194            public static void clearTeams(long pk)
1195                    throws com.liferay.portal.kernel.exception.SystemException {
1196                    getPersistence().clearTeams(pk);
1197            }
1198    
1199            /**
1200            * Removes the association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1201            *
1202            * @param pk the primary key of the user group
1203            * @param teamPK the primary key of the team
1204            * @throws SystemException if a system exception occurred
1205            */
1206            public static void removeTeam(long pk, long teamPK)
1207                    throws com.liferay.portal.kernel.exception.SystemException {
1208                    getPersistence().removeTeam(pk, teamPK);
1209            }
1210    
1211            /**
1212            * Removes the association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1213            *
1214            * @param pk the primary key of the user group
1215            * @param team the team
1216            * @throws SystemException if a system exception occurred
1217            */
1218            public static void removeTeam(long pk, com.liferay.portal.model.Team team)
1219                    throws com.liferay.portal.kernel.exception.SystemException {
1220                    getPersistence().removeTeam(pk, team);
1221            }
1222    
1223            /**
1224            * Removes the association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1225            *
1226            * @param pk the primary key of the user group
1227            * @param teamPKs the primary keys of the teams
1228            * @throws SystemException if a system exception occurred
1229            */
1230            public static void removeTeams(long pk, long[] teamPKs)
1231                    throws com.liferay.portal.kernel.exception.SystemException {
1232                    getPersistence().removeTeams(pk, teamPKs);
1233            }
1234    
1235            /**
1236            * Removes the association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1237            *
1238            * @param pk the primary key of the user group
1239            * @param teams the teams
1240            * @throws SystemException if a system exception occurred
1241            */
1242            public static void removeTeams(long pk,
1243                    java.util.List<com.liferay.portal.model.Team> teams)
1244                    throws com.liferay.portal.kernel.exception.SystemException {
1245                    getPersistence().removeTeams(pk, teams);
1246            }
1247    
1248            /**
1249            * Sets the teams associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1250            *
1251            * @param pk the primary key of the user group to set the associations for
1252            * @param teamPKs the primary keys of the teams to be associated with the user group
1253            * @throws SystemException if a system exception occurred
1254            */
1255            public static void setTeams(long pk, long[] teamPKs)
1256                    throws com.liferay.portal.kernel.exception.SystemException {
1257                    getPersistence().setTeams(pk, teamPKs);
1258            }
1259    
1260            /**
1261            * Sets the teams associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1262            *
1263            * @param pk the primary key of the user group to set the associations for
1264            * @param teams the teams to be associated with the user group
1265            * @throws SystemException if a system exception occurred
1266            */
1267            public static void setTeams(long pk,
1268                    java.util.List<com.liferay.portal.model.Team> teams)
1269                    throws com.liferay.portal.kernel.exception.SystemException {
1270                    getPersistence().setTeams(pk, teams);
1271            }
1272    
1273            /**
1274            * Gets all the users associated with the user group.
1275            *
1276            * @param pk the primary key of the user group to get the associated users for
1277            * @return the users associated with the user group
1278            * @throws SystemException if a system exception occurred
1279            */
1280            public static java.util.List<com.liferay.portal.model.User> getUsers(
1281                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1282                    return getPersistence().getUsers(pk);
1283            }
1284    
1285            /**
1286            * Gets a range of all the users associated with the user group.
1287            *
1288            * <p>
1289            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1290            * </p>
1291            *
1292            * @param pk the primary key of the user group to get the associated users for
1293            * @param start the lower bound of the range of user groups to return
1294            * @param end the upper bound of the range of user groups to return (not inclusive)
1295            * @return the range of users associated with the user group
1296            * @throws SystemException if a system exception occurred
1297            */
1298            public static java.util.List<com.liferay.portal.model.User> getUsers(
1299                    long pk, int start, int end)
1300                    throws com.liferay.portal.kernel.exception.SystemException {
1301                    return getPersistence().getUsers(pk, start, end);
1302            }
1303    
1304            /**
1305            * Gets an ordered range of all the users associated with the user group.
1306            *
1307            * <p>
1308            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1309            * </p>
1310            *
1311            * @param pk the primary key of the user group to get the associated users for
1312            * @param start the lower bound of the range of user groups to return
1313            * @param end the upper bound of the range of user groups to return (not inclusive)
1314            * @param orderByComparator the comparator to order the results by
1315            * @return the ordered range of users associated with the user group
1316            * @throws SystemException if a system exception occurred
1317            */
1318            public static java.util.List<com.liferay.portal.model.User> getUsers(
1319                    long pk, int start, int end,
1320                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1321                    throws com.liferay.portal.kernel.exception.SystemException {
1322                    return getPersistence().getUsers(pk, start, end, orderByComparator);
1323            }
1324    
1325            /**
1326            * Gets the number of users associated with the user group.
1327            *
1328            * @param pk the primary key of the user group to get the number of associated users for
1329            * @return the number of users associated with the user group
1330            * @throws SystemException if a system exception occurred
1331            */
1332            public static int getUsersSize(long pk)
1333                    throws com.liferay.portal.kernel.exception.SystemException {
1334                    return getPersistence().getUsersSize(pk);
1335            }
1336    
1337            /**
1338            * Determines if the user is associated with the user group.
1339            *
1340            * @param pk the primary key of the user group
1341            * @param userPK the primary key of the user
1342            * @return <code>true</code> if the user is associated with the user group; <code>false</code> otherwise
1343            * @throws SystemException if a system exception occurred
1344            */
1345            public static boolean containsUser(long pk, long userPK)
1346                    throws com.liferay.portal.kernel.exception.SystemException {
1347                    return getPersistence().containsUser(pk, userPK);
1348            }
1349    
1350            /**
1351            * Determines if the user group has any users associated with it.
1352            *
1353            * @param pk the primary key of the user group to check for associations with users
1354            * @return <code>true</code> if the user group has any users associated with it; <code>false</code> otherwise
1355            * @throws SystemException if a system exception occurred
1356            */
1357            public static boolean containsUsers(long pk)
1358                    throws com.liferay.portal.kernel.exception.SystemException {
1359                    return getPersistence().containsUsers(pk);
1360            }
1361    
1362            /**
1363            * Adds an association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1364            *
1365            * @param pk the primary key of the user group
1366            * @param userPK the primary key of the user
1367            * @throws SystemException if a system exception occurred
1368            */
1369            public static void addUser(long pk, long userPK)
1370                    throws com.liferay.portal.kernel.exception.SystemException {
1371                    getPersistence().addUser(pk, userPK);
1372            }
1373    
1374            /**
1375            * Adds an association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1376            *
1377            * @param pk the primary key of the user group
1378            * @param user the user
1379            * @throws SystemException if a system exception occurred
1380            */
1381            public static void addUser(long pk, com.liferay.portal.model.User user)
1382                    throws com.liferay.portal.kernel.exception.SystemException {
1383                    getPersistence().addUser(pk, user);
1384            }
1385    
1386            /**
1387            * Adds an association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1388            *
1389            * @param pk the primary key of the user group
1390            * @param userPKs the primary keys of the users
1391            * @throws SystemException if a system exception occurred
1392            */
1393            public static void addUsers(long pk, long[] userPKs)
1394                    throws com.liferay.portal.kernel.exception.SystemException {
1395                    getPersistence().addUsers(pk, userPKs);
1396            }
1397    
1398            /**
1399            * Adds an association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1400            *
1401            * @param pk the primary key of the user group
1402            * @param users the users
1403            * @throws SystemException if a system exception occurred
1404            */
1405            public static void addUsers(long pk,
1406                    java.util.List<com.liferay.portal.model.User> users)
1407                    throws com.liferay.portal.kernel.exception.SystemException {
1408                    getPersistence().addUsers(pk, users);
1409            }
1410    
1411            /**
1412            * Clears all associations between the user group and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1413            *
1414            * @param pk the primary key of the user group to clear the associated users from
1415            * @throws SystemException if a system exception occurred
1416            */
1417            public static void clearUsers(long pk)
1418                    throws com.liferay.portal.kernel.exception.SystemException {
1419                    getPersistence().clearUsers(pk);
1420            }
1421    
1422            /**
1423            * Removes the association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1424            *
1425            * @param pk the primary key of the user group
1426            * @param userPK the primary key of the user
1427            * @throws SystemException if a system exception occurred
1428            */
1429            public static void removeUser(long pk, long userPK)
1430                    throws com.liferay.portal.kernel.exception.SystemException {
1431                    getPersistence().removeUser(pk, userPK);
1432            }
1433    
1434            /**
1435            * Removes the association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1436            *
1437            * @param pk the primary key of the user group
1438            * @param user the user
1439            * @throws SystemException if a system exception occurred
1440            */
1441            public static void removeUser(long pk, com.liferay.portal.model.User user)
1442                    throws com.liferay.portal.kernel.exception.SystemException {
1443                    getPersistence().removeUser(pk, user);
1444            }
1445    
1446            /**
1447            * Removes the association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1448            *
1449            * @param pk the primary key of the user group
1450            * @param userPKs the primary keys of the users
1451            * @throws SystemException if a system exception occurred
1452            */
1453            public static void removeUsers(long pk, long[] userPKs)
1454                    throws com.liferay.portal.kernel.exception.SystemException {
1455                    getPersistence().removeUsers(pk, userPKs);
1456            }
1457    
1458            /**
1459            * Removes the association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1460            *
1461            * @param pk the primary key of the user group
1462            * @param users the users
1463            * @throws SystemException if a system exception occurred
1464            */
1465            public static void removeUsers(long pk,
1466                    java.util.List<com.liferay.portal.model.User> users)
1467                    throws com.liferay.portal.kernel.exception.SystemException {
1468                    getPersistence().removeUsers(pk, users);
1469            }
1470    
1471            /**
1472            * Sets the users associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1473            *
1474            * @param pk the primary key of the user group to set the associations for
1475            * @param userPKs the primary keys of the users to be associated with the user group
1476            * @throws SystemException if a system exception occurred
1477            */
1478            public static void setUsers(long pk, long[] userPKs)
1479                    throws com.liferay.portal.kernel.exception.SystemException {
1480                    getPersistence().setUsers(pk, userPKs);
1481            }
1482    
1483            /**
1484            * Sets the users associated with the user group, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1485            *
1486            * @param pk the primary key of the user group to set the associations for
1487            * @param users the users to be associated with the user group
1488            * @throws SystemException if a system exception occurred
1489            */
1490            public static void setUsers(long pk,
1491                    java.util.List<com.liferay.portal.model.User> users)
1492                    throws com.liferay.portal.kernel.exception.SystemException {
1493                    getPersistence().setUsers(pk, users);
1494            }
1495    
1496            public static UserGroupPersistence getPersistence() {
1497                    if (_persistence == null) {
1498                            _persistence = (UserGroupPersistence)PortalBeanLocatorUtil.locate(UserGroupPersistence.class.getName());
1499    
1500                            ReferenceRegistry.registerReference(UserGroupUtil.class,
1501                                    "_persistence");
1502                    }
1503    
1504                    return _persistence;
1505            }
1506    
1507            public void setPersistence(UserGroupPersistence persistence) {
1508                    _persistence = persistence;
1509    
1510                    ReferenceRegistry.registerReference(UserGroupUtil.class, "_persistence");
1511            }
1512    
1513            private static UserGroupPersistence _persistence;
1514    }