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
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
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
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            * Returns 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
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            * Returns 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
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            * Returns all the user groups where companyId = &#63;.
199            *
200            * @param companyId the company ID
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            * Returns 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
218            * @param start the lower bound of the range of user groups
219            * @param end the upper bound of the range of user groups (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            * Returns 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
237            * @param start the lower bound of the range of user groups
238            * @param end the upper bound of the range of user groups (not inclusive)
239            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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            * Returns 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
259            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
281            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
304            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns all the user groups that the user has permission to view where companyId = &#63;.
321            *
322            * @param companyId the company ID
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            * Returns a range of all the user groups that the user has permission to view 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
340            * @param start the lower bound of the range of user groups
341            * @param end the upper bound of the range of user groups (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            * Returns an ordered range of all the user groups that the user has permissions to view 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
359            * @param start the lower bound of the range of user groups
360            * @param end the upper bound of the range of user groups (not inclusive)
361            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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            * Returns the user groups before and after the current user group in the ordered set of user groups that the user has permission to view where companyId = &#63;.
376            *
377            * @param userGroupId the primary key of the current user group
378            * @param companyId the company ID
379            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
380            * @return the previous, current, and next user group
381            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
382            * @throws SystemException if a system exception occurred
383            */
384            public static com.liferay.portal.model.UserGroup[] filterFindByCompanyId_PrevAndNext(
385                    long userGroupId, long companyId,
386                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
387                    throws com.liferay.portal.NoSuchUserGroupException,
388                            com.liferay.portal.kernel.exception.SystemException {
389                    return getPersistence()
390                                       .filterFindByCompanyId_PrevAndNext(userGroupId, companyId,
391                            orderByComparator);
392            }
393    
394            /**
395            * Returns all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
396            *
397            * @param companyId the company ID
398            * @param parentUserGroupId the parent user group ID
399            * @return the matching user groups
400            * @throws SystemException if a system exception occurred
401            */
402            public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
403                    long companyId, long parentUserGroupId)
404                    throws com.liferay.portal.kernel.exception.SystemException {
405                    return getPersistence().findByC_P(companyId, parentUserGroupId);
406            }
407    
408            /**
409            * Returns a range of all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
410            *
411            * <p>
412            * 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.
413            * </p>
414            *
415            * @param companyId the company ID
416            * @param parentUserGroupId the parent user group ID
417            * @param start the lower bound of the range of user groups
418            * @param end the upper bound of the range of user groups (not inclusive)
419            * @return the range of matching user groups
420            * @throws SystemException if a system exception occurred
421            */
422            public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
423                    long companyId, long parentUserGroupId, int start, int end)
424                    throws com.liferay.portal.kernel.exception.SystemException {
425                    return getPersistence()
426                                       .findByC_P(companyId, parentUserGroupId, start, end);
427            }
428    
429            /**
430            * Returns an ordered range of all the user groups where companyId = &#63; and parentUserGroupId = &#63;.
431            *
432            * <p>
433            * 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.
434            * </p>
435            *
436            * @param companyId the company ID
437            * @param parentUserGroupId the parent user group ID
438            * @param start the lower bound of the range of user groups
439            * @param end the upper bound of the range of user groups (not inclusive)
440            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
441            * @return the ordered range of matching user groups
442            * @throws SystemException if a system exception occurred
443            */
444            public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
445                    long companyId, long parentUserGroupId, int start, int end,
446                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
447                    throws com.liferay.portal.kernel.exception.SystemException {
448                    return getPersistence()
449                                       .findByC_P(companyId, parentUserGroupId, start, end,
450                            orderByComparator);
451            }
452    
453            /**
454            * Returns the first user group in the ordered set where companyId = &#63; and parentUserGroupId = &#63;.
455            *
456            * <p>
457            * 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.
458            * </p>
459            *
460            * @param companyId the company ID
461            * @param parentUserGroupId the parent user group ID
462            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
463            * @return the first matching user group
464            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
465            * @throws SystemException if a system exception occurred
466            */
467            public static com.liferay.portal.model.UserGroup findByC_P_First(
468                    long companyId, long parentUserGroupId,
469                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
470                    throws com.liferay.portal.NoSuchUserGroupException,
471                            com.liferay.portal.kernel.exception.SystemException {
472                    return getPersistence()
473                                       .findByC_P_First(companyId, parentUserGroupId,
474                            orderByComparator);
475            }
476    
477            /**
478            * Returns the last user group in the ordered set where companyId = &#63; and parentUserGroupId = &#63;.
479            *
480            * <p>
481            * 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.
482            * </p>
483            *
484            * @param companyId the company ID
485            * @param parentUserGroupId the parent user group ID
486            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
487            * @return the last matching user group
488            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
489            * @throws SystemException if a system exception occurred
490            */
491            public static com.liferay.portal.model.UserGroup findByC_P_Last(
492                    long companyId, long parentUserGroupId,
493                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
494                    throws com.liferay.portal.NoSuchUserGroupException,
495                            com.liferay.portal.kernel.exception.SystemException {
496                    return getPersistence()
497                                       .findByC_P_Last(companyId, parentUserGroupId,
498                            orderByComparator);
499            }
500    
501            /**
502            * Returns the user groups before and after the current user group in the ordered set where companyId = &#63; and parentUserGroupId = &#63;.
503            *
504            * <p>
505            * 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.
506            * </p>
507            *
508            * @param userGroupId the primary key of the current user group
509            * @param companyId the company ID
510            * @param parentUserGroupId the parent user group ID
511            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
512            * @return the previous, current, and next user group
513            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
514            * @throws SystemException if a system exception occurred
515            */
516            public static com.liferay.portal.model.UserGroup[] findByC_P_PrevAndNext(
517                    long userGroupId, long companyId, long parentUserGroupId,
518                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
519                    throws com.liferay.portal.NoSuchUserGroupException,
520                            com.liferay.portal.kernel.exception.SystemException {
521                    return getPersistence()
522                                       .findByC_P_PrevAndNext(userGroupId, companyId,
523                            parentUserGroupId, orderByComparator);
524            }
525    
526            /**
527            * Returns all the user groups that the user has permission to view where companyId = &#63; and parentUserGroupId = &#63;.
528            *
529            * @param companyId the company ID
530            * @param parentUserGroupId the parent user group ID
531            * @return the matching user groups that the user has permission to view
532            * @throws SystemException if a system exception occurred
533            */
534            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByC_P(
535                    long companyId, long parentUserGroupId)
536                    throws com.liferay.portal.kernel.exception.SystemException {
537                    return getPersistence().filterFindByC_P(companyId, parentUserGroupId);
538            }
539    
540            /**
541            * Returns a range of all the user groups that the user has permission to view where companyId = &#63; and parentUserGroupId = &#63;.
542            *
543            * <p>
544            * 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.
545            * </p>
546            *
547            * @param companyId the company ID
548            * @param parentUserGroupId the parent user group ID
549            * @param start the lower bound of the range of user groups
550            * @param end the upper bound of the range of user groups (not inclusive)
551            * @return the range of matching user groups that the user has permission to view
552            * @throws SystemException if a system exception occurred
553            */
554            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByC_P(
555                    long companyId, long parentUserGroupId, int start, int end)
556                    throws com.liferay.portal.kernel.exception.SystemException {
557                    return getPersistence()
558                                       .filterFindByC_P(companyId, parentUserGroupId, start, end);
559            }
560    
561            /**
562            * Returns an ordered range of all the user groups that the user has permissions to view where companyId = &#63; and parentUserGroupId = &#63;.
563            *
564            * <p>
565            * 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.
566            * </p>
567            *
568            * @param companyId the company ID
569            * @param parentUserGroupId the parent user group ID
570            * @param start the lower bound of the range of user groups
571            * @param end the upper bound of the range of user groups (not inclusive)
572            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
573            * @return the ordered range of matching user groups that the user has permission to view
574            * @throws SystemException if a system exception occurred
575            */
576            public static java.util.List<com.liferay.portal.model.UserGroup> filterFindByC_P(
577                    long companyId, long parentUserGroupId, int start, int end,
578                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
579                    throws com.liferay.portal.kernel.exception.SystemException {
580                    return getPersistence()
581                                       .filterFindByC_P(companyId, parentUserGroupId, start, end,
582                            orderByComparator);
583            }
584    
585            /**
586            * Returns the user groups before and after the current user group in the ordered set of user groups that the user has permission to view where companyId = &#63; and parentUserGroupId = &#63;.
587            *
588            * @param userGroupId the primary key of the current user group
589            * @param companyId the company ID
590            * @param parentUserGroupId the parent user group ID
591            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
592            * @return the previous, current, and next user group
593            * @throws com.liferay.portal.NoSuchUserGroupException if a user group with the primary key could not be found
594            * @throws SystemException if a system exception occurred
595            */
596            public static com.liferay.portal.model.UserGroup[] filterFindByC_P_PrevAndNext(
597                    long userGroupId, long companyId, long parentUserGroupId,
598                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
599                    throws com.liferay.portal.NoSuchUserGroupException,
600                            com.liferay.portal.kernel.exception.SystemException {
601                    return getPersistence()
602                                       .filterFindByC_P_PrevAndNext(userGroupId, companyId,
603                            parentUserGroupId, orderByComparator);
604            }
605    
606            /**
607            * Returns the user group where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchUserGroupException} if it could not be found.
608            *
609            * @param companyId the company ID
610            * @param name the name
611            * @return the matching user group
612            * @throws com.liferay.portal.NoSuchUserGroupException if a matching user group could not be found
613            * @throws SystemException if a system exception occurred
614            */
615            public static com.liferay.portal.model.UserGroup findByC_N(long companyId,
616                    java.lang.String name)
617                    throws com.liferay.portal.NoSuchUserGroupException,
618                            com.liferay.portal.kernel.exception.SystemException {
619                    return getPersistence().findByC_N(companyId, name);
620            }
621    
622            /**
623            * Returns the user group where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
624            *
625            * @param companyId the company ID
626            * @param name the name
627            * @return the matching user group, or <code>null</code> if a matching user group could not be found
628            * @throws SystemException if a system exception occurred
629            */
630            public static com.liferay.portal.model.UserGroup fetchByC_N(
631                    long companyId, java.lang.String name)
632                    throws com.liferay.portal.kernel.exception.SystemException {
633                    return getPersistence().fetchByC_N(companyId, name);
634            }
635    
636            /**
637            * Returns 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.
638            *
639            * @param companyId the company ID
640            * @param name the name
641            * @param retrieveFromCache whether to use the finder cache
642            * @return the matching user group, or <code>null</code> if a matching user group could not be found
643            * @throws SystemException if a system exception occurred
644            */
645            public static com.liferay.portal.model.UserGroup fetchByC_N(
646                    long companyId, java.lang.String name, boolean retrieveFromCache)
647                    throws com.liferay.portal.kernel.exception.SystemException {
648                    return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
649            }
650    
651            /**
652            * Returns all the user groups.
653            *
654            * @return the user groups
655            * @throws SystemException if a system exception occurred
656            */
657            public static java.util.List<com.liferay.portal.model.UserGroup> findAll()
658                    throws com.liferay.portal.kernel.exception.SystemException {
659                    return getPersistence().findAll();
660            }
661    
662            /**
663            * Returns a range of all the user groups.
664            *
665            * <p>
666            * 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.
667            * </p>
668            *
669            * @param start the lower bound of the range of user groups
670            * @param end the upper bound of the range of user groups (not inclusive)
671            * @return the range of user groups
672            * @throws SystemException if a system exception occurred
673            */
674            public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
675                    int start, int end)
676                    throws com.liferay.portal.kernel.exception.SystemException {
677                    return getPersistence().findAll(start, end);
678            }
679    
680            /**
681            * Returns an ordered range of all the user groups.
682            *
683            * <p>
684            * 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.
685            * </p>
686            *
687            * @param start the lower bound of the range of user groups
688            * @param end the upper bound of the range of user groups (not inclusive)
689            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
690            * @return the ordered range of user groups
691            * @throws SystemException if a system exception occurred
692            */
693            public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
694                    int start, int end,
695                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
696                    throws com.liferay.portal.kernel.exception.SystemException {
697                    return getPersistence().findAll(start, end, orderByComparator);
698            }
699    
700            /**
701            * Removes all the user groups where companyId = &#63; from the database.
702            *
703            * @param companyId the company ID
704            * @throws SystemException if a system exception occurred
705            */
706            public static void removeByCompanyId(long companyId)
707                    throws com.liferay.portal.kernel.exception.SystemException {
708                    getPersistence().removeByCompanyId(companyId);
709            }
710    
711            /**
712            * Removes all the user groups where companyId = &#63; and parentUserGroupId = &#63; from the database.
713            *
714            * @param companyId the company ID
715            * @param parentUserGroupId the parent user group ID
716            * @throws SystemException if a system exception occurred
717            */
718            public static void removeByC_P(long companyId, long parentUserGroupId)
719                    throws com.liferay.portal.kernel.exception.SystemException {
720                    getPersistence().removeByC_P(companyId, parentUserGroupId);
721            }
722    
723            /**
724            * Removes the user group where companyId = &#63; and name = &#63; from the database.
725            *
726            * @param companyId the company ID
727            * @param name the name
728            * @throws SystemException if a system exception occurred
729            */
730            public static void removeByC_N(long companyId, java.lang.String name)
731                    throws com.liferay.portal.NoSuchUserGroupException,
732                            com.liferay.portal.kernel.exception.SystemException {
733                    getPersistence().removeByC_N(companyId, name);
734            }
735    
736            /**
737            * Removes all the user groups from the database.
738            *
739            * @throws SystemException if a system exception occurred
740            */
741            public static void removeAll()
742                    throws com.liferay.portal.kernel.exception.SystemException {
743                    getPersistence().removeAll();
744            }
745    
746            /**
747            * Returns the number of user groups where companyId = &#63;.
748            *
749            * @param companyId the company ID
750            * @return the number of matching user groups
751            * @throws SystemException if a system exception occurred
752            */
753            public static int countByCompanyId(long companyId)
754                    throws com.liferay.portal.kernel.exception.SystemException {
755                    return getPersistence().countByCompanyId(companyId);
756            }
757    
758            /**
759            * Returns the number of user groups that the user has permission to view where companyId = &#63;.
760            *
761            * @param companyId the company ID
762            * @return the number of matching user groups that the user has permission to view
763            * @throws SystemException if a system exception occurred
764            */
765            public static int filterCountByCompanyId(long companyId)
766                    throws com.liferay.portal.kernel.exception.SystemException {
767                    return getPersistence().filterCountByCompanyId(companyId);
768            }
769    
770            /**
771            * Returns the number of user groups where companyId = &#63; and parentUserGroupId = &#63;.
772            *
773            * @param companyId the company ID
774            * @param parentUserGroupId the parent user group ID
775            * @return the number of matching user groups
776            * @throws SystemException if a system exception occurred
777            */
778            public static int countByC_P(long companyId, long parentUserGroupId)
779                    throws com.liferay.portal.kernel.exception.SystemException {
780                    return getPersistence().countByC_P(companyId, parentUserGroupId);
781            }
782    
783            /**
784            * Returns the number of user groups that the user has permission to view where companyId = &#63; and parentUserGroupId = &#63;.
785            *
786            * @param companyId the company ID
787            * @param parentUserGroupId the parent user group ID
788            * @return the number of matching user groups that the user has permission to view
789            * @throws SystemException if a system exception occurred
790            */
791            public static int filterCountByC_P(long companyId, long parentUserGroupId)
792                    throws com.liferay.portal.kernel.exception.SystemException {
793                    return getPersistence().filterCountByC_P(companyId, parentUserGroupId);
794            }
795    
796            /**
797            * Returns the number of user groups where companyId = &#63; and name = &#63;.
798            *
799            * @param companyId the company ID
800            * @param name the name
801            * @return the number of matching user groups
802            * @throws SystemException if a system exception occurred
803            */
804            public static int countByC_N(long companyId, java.lang.String name)
805                    throws com.liferay.portal.kernel.exception.SystemException {
806                    return getPersistence().countByC_N(companyId, name);
807            }
808    
809            /**
810            * Returns the number of user groups.
811            *
812            * @return the number of user groups
813            * @throws SystemException if a system exception occurred
814            */
815            public static int countAll()
816                    throws com.liferay.portal.kernel.exception.SystemException {
817                    return getPersistence().countAll();
818            }
819    
820            /**
821            * Returns all the groups associated with the user group.
822            *
823            * @param pk the primary key of the user group
824            * @return the groups associated with the user group
825            * @throws SystemException if a system exception occurred
826            */
827            public static java.util.List<com.liferay.portal.model.Group> getGroups(
828                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
829                    return getPersistence().getGroups(pk);
830            }
831    
832            /**
833            * Returns a range of all the groups associated with the user group.
834            *
835            * <p>
836            * 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.
837            * </p>
838            *
839            * @param pk the primary key of the user group
840            * @param start the lower bound of the range of user groups
841            * @param end the upper bound of the range of user groups (not inclusive)
842            * @return the range of groups associated with the user group
843            * @throws SystemException if a system exception occurred
844            */
845            public static java.util.List<com.liferay.portal.model.Group> getGroups(
846                    long pk, int start, int end)
847                    throws com.liferay.portal.kernel.exception.SystemException {
848                    return getPersistence().getGroups(pk, start, end);
849            }
850    
851            /**
852            * Returns an ordered range of all the groups associated with the user group.
853            *
854            * <p>
855            * 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.
856            * </p>
857            *
858            * @param pk the primary key of the user group
859            * @param start the lower bound of the range of user groups
860            * @param end the upper bound of the range of user groups (not inclusive)
861            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
862            * @return the ordered range of groups associated with the user group
863            * @throws SystemException if a system exception occurred
864            */
865            public static java.util.List<com.liferay.portal.model.Group> getGroups(
866                    long pk, int start, int end,
867                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
868                    throws com.liferay.portal.kernel.exception.SystemException {
869                    return getPersistence().getGroups(pk, start, end, orderByComparator);
870            }
871    
872            /**
873            * Returns the number of groups associated with the user group.
874            *
875            * @param pk the primary key of the user group
876            * @return the number of groups associated with the user group
877            * @throws SystemException if a system exception occurred
878            */
879            public static int getGroupsSize(long pk)
880                    throws com.liferay.portal.kernel.exception.SystemException {
881                    return getPersistence().getGroupsSize(pk);
882            }
883    
884            /**
885            * Returns <code>true</code> if the group is associated with the user group.
886            *
887            * @param pk the primary key of the user group
888            * @param groupPK the primary key of the group
889            * @return <code>true</code> if the group is associated with the user group; <code>false</code> otherwise
890            * @throws SystemException if a system exception occurred
891            */
892            public static boolean containsGroup(long pk, long groupPK)
893                    throws com.liferay.portal.kernel.exception.SystemException {
894                    return getPersistence().containsGroup(pk, groupPK);
895            }
896    
897            /**
898            * Returns <code>true</code> if the user group has any groups associated with it.
899            *
900            * @param pk the primary key of the user group to check for associations with groups
901            * @return <code>true</code> if the user group has any groups associated with it; <code>false</code> otherwise
902            * @throws SystemException if a system exception occurred
903            */
904            public static boolean containsGroups(long pk)
905                    throws com.liferay.portal.kernel.exception.SystemException {
906                    return getPersistence().containsGroups(pk);
907            }
908    
909            /**
910            * Adds an association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
911            *
912            * @param pk the primary key of the user group
913            * @param groupPK the primary key of the group
914            * @throws SystemException if a system exception occurred
915            */
916            public static void addGroup(long pk, long groupPK)
917                    throws com.liferay.portal.kernel.exception.SystemException {
918                    getPersistence().addGroup(pk, groupPK);
919            }
920    
921            /**
922            * Adds an association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
923            *
924            * @param pk the primary key of the user group
925            * @param group the group
926            * @throws SystemException if a system exception occurred
927            */
928            public static void addGroup(long pk, com.liferay.portal.model.Group group)
929                    throws com.liferay.portal.kernel.exception.SystemException {
930                    getPersistence().addGroup(pk, group);
931            }
932    
933            /**
934            * Adds an association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
935            *
936            * @param pk the primary key of the user group
937            * @param groupPKs the primary keys of the groups
938            * @throws SystemException if a system exception occurred
939            */
940            public static void addGroups(long pk, long[] groupPKs)
941                    throws com.liferay.portal.kernel.exception.SystemException {
942                    getPersistence().addGroups(pk, groupPKs);
943            }
944    
945            /**
946            * Adds an association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
947            *
948            * @param pk the primary key of the user group
949            * @param groups the groups
950            * @throws SystemException if a system exception occurred
951            */
952            public static void addGroups(long pk,
953                    java.util.List<com.liferay.portal.model.Group> groups)
954                    throws com.liferay.portal.kernel.exception.SystemException {
955                    getPersistence().addGroups(pk, groups);
956            }
957    
958            /**
959            * Clears all associations between the user group and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
960            *
961            * @param pk the primary key of the user group to clear the associated groups from
962            * @throws SystemException if a system exception occurred
963            */
964            public static void clearGroups(long pk)
965                    throws com.liferay.portal.kernel.exception.SystemException {
966                    getPersistence().clearGroups(pk);
967            }
968    
969            /**
970            * Removes the association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
971            *
972            * @param pk the primary key of the user group
973            * @param groupPK the primary key of the group
974            * @throws SystemException if a system exception occurred
975            */
976            public static void removeGroup(long pk, long groupPK)
977                    throws com.liferay.portal.kernel.exception.SystemException {
978                    getPersistence().removeGroup(pk, groupPK);
979            }
980    
981            /**
982            * Removes the association between the user group and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
983            *
984            * @param pk the primary key of the user group
985            * @param group the group
986            * @throws SystemException if a system exception occurred
987            */
988            public static void removeGroup(long pk, com.liferay.portal.model.Group group)
989                    throws com.liferay.portal.kernel.exception.SystemException {
990                    getPersistence().removeGroup(pk, group);
991            }
992    
993            /**
994            * Removes the association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
995            *
996            * @param pk the primary key of the user group
997            * @param groupPKs the primary keys of the groups
998            * @throws SystemException if a system exception occurred
999            */
1000            public static void removeGroups(long pk, long[] groupPKs)
1001                    throws com.liferay.portal.kernel.exception.SystemException {
1002                    getPersistence().removeGroups(pk, groupPKs);
1003            }
1004    
1005            /**
1006            * Removes the association between the user group and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1007            *
1008            * @param pk the primary key of the user group
1009            * @param groups the groups
1010            * @throws SystemException if a system exception occurred
1011            */
1012            public static void removeGroups(long pk,
1013                    java.util.List<com.liferay.portal.model.Group> groups)
1014                    throws com.liferay.portal.kernel.exception.SystemException {
1015                    getPersistence().removeGroups(pk, groups);
1016            }
1017    
1018            /**
1019            * 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.
1020            *
1021            * @param pk the primary key of the user group
1022            * @param groupPKs the primary keys of the groups to be associated with the user group
1023            * @throws SystemException if a system exception occurred
1024            */
1025            public static void setGroups(long pk, long[] groupPKs)
1026                    throws com.liferay.portal.kernel.exception.SystemException {
1027                    getPersistence().setGroups(pk, groupPKs);
1028            }
1029    
1030            /**
1031            * 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.
1032            *
1033            * @param pk the primary key of the user group
1034            * @param groups the groups to be associated with the user group
1035            * @throws SystemException if a system exception occurred
1036            */
1037            public static void setGroups(long pk,
1038                    java.util.List<com.liferay.portal.model.Group> groups)
1039                    throws com.liferay.portal.kernel.exception.SystemException {
1040                    getPersistence().setGroups(pk, groups);
1041            }
1042    
1043            /**
1044            * Returns all the teams associated with the user group.
1045            *
1046            * @param pk the primary key of the user group
1047            * @return the teams associated with the user group
1048            * @throws SystemException if a system exception occurred
1049            */
1050            public static java.util.List<com.liferay.portal.model.Team> getTeams(
1051                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1052                    return getPersistence().getTeams(pk);
1053            }
1054    
1055            /**
1056            * Returns a range of all the teams associated with the user group.
1057            *
1058            * <p>
1059            * 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.
1060            * </p>
1061            *
1062            * @param pk the primary key of the user group
1063            * @param start the lower bound of the range of user groups
1064            * @param end the upper bound of the range of user groups (not inclusive)
1065            * @return the range of teams associated with the user group
1066            * @throws SystemException if a system exception occurred
1067            */
1068            public static java.util.List<com.liferay.portal.model.Team> getTeams(
1069                    long pk, int start, int end)
1070                    throws com.liferay.portal.kernel.exception.SystemException {
1071                    return getPersistence().getTeams(pk, start, end);
1072            }
1073    
1074            /**
1075            * Returns an ordered range of all the teams associated with the user group.
1076            *
1077            * <p>
1078            * 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.
1079            * </p>
1080            *
1081            * @param pk the primary key of the user group
1082            * @param start the lower bound of the range of user groups
1083            * @param end the upper bound of the range of user groups (not inclusive)
1084            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1085            * @return the ordered range of teams associated with the user group
1086            * @throws SystemException if a system exception occurred
1087            */
1088            public static java.util.List<com.liferay.portal.model.Team> getTeams(
1089                    long pk, int start, int end,
1090                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1091                    throws com.liferay.portal.kernel.exception.SystemException {
1092                    return getPersistence().getTeams(pk, start, end, orderByComparator);
1093            }
1094    
1095            /**
1096            * Returns the number of teams associated with the user group.
1097            *
1098            * @param pk the primary key of the user group
1099            * @return the number of teams associated with the user group
1100            * @throws SystemException if a system exception occurred
1101            */
1102            public static int getTeamsSize(long pk)
1103                    throws com.liferay.portal.kernel.exception.SystemException {
1104                    return getPersistence().getTeamsSize(pk);
1105            }
1106    
1107            /**
1108            * Returns <code>true</code> if the team is associated with the user group.
1109            *
1110            * @param pk the primary key of the user group
1111            * @param teamPK the primary key of the team
1112            * @return <code>true</code> if the team is associated with the user group; <code>false</code> otherwise
1113            * @throws SystemException if a system exception occurred
1114            */
1115            public static boolean containsTeam(long pk, long teamPK)
1116                    throws com.liferay.portal.kernel.exception.SystemException {
1117                    return getPersistence().containsTeam(pk, teamPK);
1118            }
1119    
1120            /**
1121            * Returns <code>true</code> if the user group has any teams associated with it.
1122            *
1123            * @param pk the primary key of the user group to check for associations with teams
1124            * @return <code>true</code> if the user group has any teams associated with it; <code>false</code> otherwise
1125            * @throws SystemException if a system exception occurred
1126            */
1127            public static boolean containsTeams(long pk)
1128                    throws com.liferay.portal.kernel.exception.SystemException {
1129                    return getPersistence().containsTeams(pk);
1130            }
1131    
1132            /**
1133            * Adds an association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1134            *
1135            * @param pk the primary key of the user group
1136            * @param teamPK the primary key of the team
1137            * @throws SystemException if a system exception occurred
1138            */
1139            public static void addTeam(long pk, long teamPK)
1140                    throws com.liferay.portal.kernel.exception.SystemException {
1141                    getPersistence().addTeam(pk, teamPK);
1142            }
1143    
1144            /**
1145            * Adds an association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1146            *
1147            * @param pk the primary key of the user group
1148            * @param team the team
1149            * @throws SystemException if a system exception occurred
1150            */
1151            public static void addTeam(long pk, com.liferay.portal.model.Team team)
1152                    throws com.liferay.portal.kernel.exception.SystemException {
1153                    getPersistence().addTeam(pk, team);
1154            }
1155    
1156            /**
1157            * Adds an association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1158            *
1159            * @param pk the primary key of the user group
1160            * @param teamPKs the primary keys of the teams
1161            * @throws SystemException if a system exception occurred
1162            */
1163            public static void addTeams(long pk, long[] teamPKs)
1164                    throws com.liferay.portal.kernel.exception.SystemException {
1165                    getPersistence().addTeams(pk, teamPKs);
1166            }
1167    
1168            /**
1169            * Adds an association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1170            *
1171            * @param pk the primary key of the user group
1172            * @param teams the teams
1173            * @throws SystemException if a system exception occurred
1174            */
1175            public static void addTeams(long pk,
1176                    java.util.List<com.liferay.portal.model.Team> teams)
1177                    throws com.liferay.portal.kernel.exception.SystemException {
1178                    getPersistence().addTeams(pk, teams);
1179            }
1180    
1181            /**
1182            * Clears all associations between the user group and its teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1183            *
1184            * @param pk the primary key of the user group to clear the associated teams from
1185            * @throws SystemException if a system exception occurred
1186            */
1187            public static void clearTeams(long pk)
1188                    throws com.liferay.portal.kernel.exception.SystemException {
1189                    getPersistence().clearTeams(pk);
1190            }
1191    
1192            /**
1193            * Removes the association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1194            *
1195            * @param pk the primary key of the user group
1196            * @param teamPK the primary key of the team
1197            * @throws SystemException if a system exception occurred
1198            */
1199            public static void removeTeam(long pk, long teamPK)
1200                    throws com.liferay.portal.kernel.exception.SystemException {
1201                    getPersistence().removeTeam(pk, teamPK);
1202            }
1203    
1204            /**
1205            * Removes the association between the user group and the team. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1206            *
1207            * @param pk the primary key of the user group
1208            * @param team the team
1209            * @throws SystemException if a system exception occurred
1210            */
1211            public static void removeTeam(long pk, com.liferay.portal.model.Team team)
1212                    throws com.liferay.portal.kernel.exception.SystemException {
1213                    getPersistence().removeTeam(pk, team);
1214            }
1215    
1216            /**
1217            * Removes the association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1218            *
1219            * @param pk the primary key of the user group
1220            * @param teamPKs the primary keys of the teams
1221            * @throws SystemException if a system exception occurred
1222            */
1223            public static void removeTeams(long pk, long[] teamPKs)
1224                    throws com.liferay.portal.kernel.exception.SystemException {
1225                    getPersistence().removeTeams(pk, teamPKs);
1226            }
1227    
1228            /**
1229            * Removes the association between the user group and the teams. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1230            *
1231            * @param pk the primary key of the user group
1232            * @param teams the teams
1233            * @throws SystemException if a system exception occurred
1234            */
1235            public static void removeTeams(long pk,
1236                    java.util.List<com.liferay.portal.model.Team> teams)
1237                    throws com.liferay.portal.kernel.exception.SystemException {
1238                    getPersistence().removeTeams(pk, teams);
1239            }
1240    
1241            /**
1242            * 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.
1243            *
1244            * @param pk the primary key of the user group
1245            * @param teamPKs the primary keys of the teams to be associated with the user group
1246            * @throws SystemException if a system exception occurred
1247            */
1248            public static void setTeams(long pk, long[] teamPKs)
1249                    throws com.liferay.portal.kernel.exception.SystemException {
1250                    getPersistence().setTeams(pk, teamPKs);
1251            }
1252    
1253            /**
1254            * 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.
1255            *
1256            * @param pk the primary key of the user group
1257            * @param teams the teams to be associated with the user group
1258            * @throws SystemException if a system exception occurred
1259            */
1260            public static void setTeams(long pk,
1261                    java.util.List<com.liferay.portal.model.Team> teams)
1262                    throws com.liferay.portal.kernel.exception.SystemException {
1263                    getPersistence().setTeams(pk, teams);
1264            }
1265    
1266            /**
1267            * Returns all the users associated with the user group.
1268            *
1269            * @param pk the primary key of the user group
1270            * @return the users associated with the user group
1271            * @throws SystemException if a system exception occurred
1272            */
1273            public static java.util.List<com.liferay.portal.model.User> getUsers(
1274                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
1275                    return getPersistence().getUsers(pk);
1276            }
1277    
1278            /**
1279            * Returns a range of all the users associated with the user group.
1280            *
1281            * <p>
1282            * 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.
1283            * </p>
1284            *
1285            * @param pk the primary key of the user group
1286            * @param start the lower bound of the range of user groups
1287            * @param end the upper bound of the range of user groups (not inclusive)
1288            * @return the range of users associated with the user group
1289            * @throws SystemException if a system exception occurred
1290            */
1291            public static java.util.List<com.liferay.portal.model.User> getUsers(
1292                    long pk, int start, int end)
1293                    throws com.liferay.portal.kernel.exception.SystemException {
1294                    return getPersistence().getUsers(pk, start, end);
1295            }
1296    
1297            /**
1298            * Returns an ordered range of all the users associated with the user group.
1299            *
1300            * <p>
1301            * 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.
1302            * </p>
1303            *
1304            * @param pk the primary key of the user group
1305            * @param start the lower bound of the range of user groups
1306            * @param end the upper bound of the range of user groups (not inclusive)
1307            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1308            * @return the ordered range of users associated with the user group
1309            * @throws SystemException if a system exception occurred
1310            */
1311            public static java.util.List<com.liferay.portal.model.User> getUsers(
1312                    long pk, int start, int end,
1313                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1314                    throws com.liferay.portal.kernel.exception.SystemException {
1315                    return getPersistence().getUsers(pk, start, end, orderByComparator);
1316            }
1317    
1318            /**
1319            * Returns the number of users associated with the user group.
1320            *
1321            * @param pk the primary key of the user group
1322            * @return the number of users associated with the user group
1323            * @throws SystemException if a system exception occurred
1324            */
1325            public static int getUsersSize(long pk)
1326                    throws com.liferay.portal.kernel.exception.SystemException {
1327                    return getPersistence().getUsersSize(pk);
1328            }
1329    
1330            /**
1331            * Returns <code>true</code> if the user is associated with the user group.
1332            *
1333            * @param pk the primary key of the user group
1334            * @param userPK the primary key of the user
1335            * @return <code>true</code> if the user is associated with the user group; <code>false</code> otherwise
1336            * @throws SystemException if a system exception occurred
1337            */
1338            public static boolean containsUser(long pk, long userPK)
1339                    throws com.liferay.portal.kernel.exception.SystemException {
1340                    return getPersistence().containsUser(pk, userPK);
1341            }
1342    
1343            /**
1344            * Returns <code>true</code> if the user group has any users associated with it.
1345            *
1346            * @param pk the primary key of the user group to check for associations with users
1347            * @return <code>true</code> if the user group has any users associated with it; <code>false</code> otherwise
1348            * @throws SystemException if a system exception occurred
1349            */
1350            public static boolean containsUsers(long pk)
1351                    throws com.liferay.portal.kernel.exception.SystemException {
1352                    return getPersistence().containsUsers(pk);
1353            }
1354    
1355            /**
1356            * Adds an association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1357            *
1358            * @param pk the primary key of the user group
1359            * @param userPK the primary key of the user
1360            * @throws SystemException if a system exception occurred
1361            */
1362            public static void addUser(long pk, long userPK)
1363                    throws com.liferay.portal.kernel.exception.SystemException {
1364                    getPersistence().addUser(pk, userPK);
1365            }
1366    
1367            /**
1368            * Adds an association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1369            *
1370            * @param pk the primary key of the user group
1371            * @param user the user
1372            * @throws SystemException if a system exception occurred
1373            */
1374            public static void addUser(long pk, com.liferay.portal.model.User user)
1375                    throws com.liferay.portal.kernel.exception.SystemException {
1376                    getPersistence().addUser(pk, user);
1377            }
1378    
1379            /**
1380            * Adds an association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1381            *
1382            * @param pk the primary key of the user group
1383            * @param userPKs the primary keys of the users
1384            * @throws SystemException if a system exception occurred
1385            */
1386            public static void addUsers(long pk, long[] userPKs)
1387                    throws com.liferay.portal.kernel.exception.SystemException {
1388                    getPersistence().addUsers(pk, userPKs);
1389            }
1390    
1391            /**
1392            * Adds an association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1393            *
1394            * @param pk the primary key of the user group
1395            * @param users the users
1396            * @throws SystemException if a system exception occurred
1397            */
1398            public static void addUsers(long pk,
1399                    java.util.List<com.liferay.portal.model.User> users)
1400                    throws com.liferay.portal.kernel.exception.SystemException {
1401                    getPersistence().addUsers(pk, users);
1402            }
1403    
1404            /**
1405            * Clears all associations between the user group and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1406            *
1407            * @param pk the primary key of the user group to clear the associated users from
1408            * @throws SystemException if a system exception occurred
1409            */
1410            public static void clearUsers(long pk)
1411                    throws com.liferay.portal.kernel.exception.SystemException {
1412                    getPersistence().clearUsers(pk);
1413            }
1414    
1415            /**
1416            * Removes the association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1417            *
1418            * @param pk the primary key of the user group
1419            * @param userPK the primary key of the user
1420            * @throws SystemException if a system exception occurred
1421            */
1422            public static void removeUser(long pk, long userPK)
1423                    throws com.liferay.portal.kernel.exception.SystemException {
1424                    getPersistence().removeUser(pk, userPK);
1425            }
1426    
1427            /**
1428            * Removes the association between the user group and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1429            *
1430            * @param pk the primary key of the user group
1431            * @param user the user
1432            * @throws SystemException if a system exception occurred
1433            */
1434            public static void removeUser(long pk, com.liferay.portal.model.User user)
1435                    throws com.liferay.portal.kernel.exception.SystemException {
1436                    getPersistence().removeUser(pk, user);
1437            }
1438    
1439            /**
1440            * Removes the association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1441            *
1442            * @param pk the primary key of the user group
1443            * @param userPKs the primary keys of the users
1444            * @throws SystemException if a system exception occurred
1445            */
1446            public static void removeUsers(long pk, long[] userPKs)
1447                    throws com.liferay.portal.kernel.exception.SystemException {
1448                    getPersistence().removeUsers(pk, userPKs);
1449            }
1450    
1451            /**
1452            * Removes the association between the user group and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1453            *
1454            * @param pk the primary key of the user group
1455            * @param users the users
1456            * @throws SystemException if a system exception occurred
1457            */
1458            public static void removeUsers(long pk,
1459                    java.util.List<com.liferay.portal.model.User> users)
1460                    throws com.liferay.portal.kernel.exception.SystemException {
1461                    getPersistence().removeUsers(pk, users);
1462            }
1463    
1464            /**
1465            * 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.
1466            *
1467            * @param pk the primary key of the user group
1468            * @param userPKs the primary keys of the users to be associated with the user group
1469            * @throws SystemException if a system exception occurred
1470            */
1471            public static void setUsers(long pk, long[] userPKs)
1472                    throws com.liferay.portal.kernel.exception.SystemException {
1473                    getPersistence().setUsers(pk, userPKs);
1474            }
1475    
1476            /**
1477            * 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.
1478            *
1479            * @param pk the primary key of the user group
1480            * @param users the users to be associated with the user group
1481            * @throws SystemException if a system exception occurred
1482            */
1483            public static void setUsers(long pk,
1484                    java.util.List<com.liferay.portal.model.User> users)
1485                    throws com.liferay.portal.kernel.exception.SystemException {
1486                    getPersistence().setUsers(pk, users);
1487            }
1488    
1489            public static UserGroupPersistence getPersistence() {
1490                    if (_persistence == null) {
1491                            _persistence = (UserGroupPersistence)PortalBeanLocatorUtil.locate(UserGroupPersistence.class.getName());
1492    
1493                            ReferenceRegistry.registerReference(UserGroupUtil.class,
1494                                    "_persistence");
1495                    }
1496    
1497                    return _persistence;
1498            }
1499    
1500            public void setPersistence(UserGroupPersistence persistence) {
1501                    _persistence = persistence;
1502    
1503                    ReferenceRegistry.registerReference(UserGroupUtil.class, "_persistence");
1504            }
1505    
1506            private static UserGroupPersistence _persistence;
1507    }