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.Team;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the team service. This utility wraps {@link TeamPersistenceImpl} 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 TeamPersistence
036     * @see TeamPersistenceImpl
037     * @generated
038     */
039    public class TeamUtil {
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(Team team) {
057                    getPersistence().clearCache(team);
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<Team> findWithDynamicQuery(DynamicQuery dynamicQuery)
072                    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<Team> findWithDynamicQuery(DynamicQuery dynamicQuery,
080                    int start, int end) throws SystemException {
081                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
082            }
083    
084            /**
085             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
086             */
087            public static List<Team> findWithDynamicQuery(DynamicQuery dynamicQuery,
088                    int start, int end, OrderByComparator orderByComparator)
089                    throws SystemException {
090                    return getPersistence()
091                                       .findWithDynamicQuery(dynamicQuery, start, end,
092                            orderByComparator);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
097             */
098            public static Team remove(Team team) throws SystemException {
099                    return getPersistence().remove(team);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
104             */
105            public static Team update(Team team, boolean merge)
106                    throws SystemException {
107                    return getPersistence().update(team, merge);
108            }
109    
110            /**
111             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
112             */
113            public static Team update(Team team, boolean merge,
114                    ServiceContext serviceContext) throws SystemException {
115                    return getPersistence().update(team, merge, serviceContext);
116            }
117    
118            /**
119            * Caches the team in the entity cache if it is enabled.
120            *
121            * @param team the team to cache
122            */
123            public static void cacheResult(com.liferay.portal.model.Team team) {
124                    getPersistence().cacheResult(team);
125            }
126    
127            /**
128            * Caches the teams in the entity cache if it is enabled.
129            *
130            * @param teams the teams to cache
131            */
132            public static void cacheResult(
133                    java.util.List<com.liferay.portal.model.Team> teams) {
134                    getPersistence().cacheResult(teams);
135            }
136    
137            /**
138            * Creates a new team with the primary key. Does not add the team to the database.
139            *
140            * @param teamId the primary key for the new team
141            * @return the new team
142            */
143            public static com.liferay.portal.model.Team create(long teamId) {
144                    return getPersistence().create(teamId);
145            }
146    
147            /**
148            * Removes the team with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param teamId the primary key of the team to remove
151            * @return the team that was removed
152            * @throws com.liferay.portal.NoSuchTeamException if a team with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portal.model.Team remove(long teamId)
156                    throws com.liferay.portal.NoSuchTeamException,
157                            com.liferay.portal.kernel.exception.SystemException {
158                    return getPersistence().remove(teamId);
159            }
160    
161            public static com.liferay.portal.model.Team updateImpl(
162                    com.liferay.portal.model.Team team, boolean merge)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().updateImpl(team, merge);
165            }
166    
167            /**
168            * Finds the team with the primary key or throws a {@link com.liferay.portal.NoSuchTeamException} if it could not be found.
169            *
170            * @param teamId the primary key of the team to find
171            * @return the team
172            * @throws com.liferay.portal.NoSuchTeamException if a team with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portal.model.Team findByPrimaryKey(long teamId)
176                    throws com.liferay.portal.NoSuchTeamException,
177                            com.liferay.portal.kernel.exception.SystemException {
178                    return getPersistence().findByPrimaryKey(teamId);
179            }
180    
181            /**
182            * Finds the team with the primary key or returns <code>null</code> if it could not be found.
183            *
184            * @param teamId the primary key of the team to find
185            * @return the team, or <code>null</code> if a team with the primary key could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public static com.liferay.portal.model.Team fetchByPrimaryKey(long teamId)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(teamId);
191            }
192    
193            /**
194            * Finds all the teams where groupId = &#63;.
195            *
196            * @param groupId the group ID to search with
197            * @return the matching teams
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portal.model.Team> findByGroupId(
201                    long groupId)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByGroupId(groupId);
204            }
205    
206            /**
207            * Finds a range of all the teams where groupId = &#63;.
208            *
209            * <p>
210            * 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.
211            * </p>
212            *
213            * @param groupId the group ID to search with
214            * @param start the lower bound of the range of teams to return
215            * @param end the upper bound of the range of teams to return (not inclusive)
216            * @return the range of matching teams
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portal.model.Team> findByGroupId(
220                    long groupId, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByGroupId(groupId, start, end);
223            }
224    
225            /**
226            * Finds an ordered range of all the teams where groupId = &#63;.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param groupId the group ID to search with
233            * @param start the lower bound of the range of teams to return
234            * @param end the upper bound of the range of teams to return (not inclusive)
235            * @param orderByComparator the comparator to order the results by
236            * @return the ordered range of matching teams
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portal.model.Team> findByGroupId(
240                    long groupId, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence()
244                                       .findByGroupId(groupId, start, end, orderByComparator);
245            }
246    
247            /**
248            * Finds the first team in the ordered set where groupId = &#63;.
249            *
250            * <p>
251            * 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.
252            * </p>
253            *
254            * @param groupId the group ID to search with
255            * @param orderByComparator the comparator to order the set by
256            * @return the first matching team
257            * @throws com.liferay.portal.NoSuchTeamException if a matching team could not be found
258            * @throws SystemException if a system exception occurred
259            */
260            public static com.liferay.portal.model.Team findByGroupId_First(
261                    long groupId,
262                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
263                    throws com.liferay.portal.NoSuchTeamException,
264                            com.liferay.portal.kernel.exception.SystemException {
265                    return getPersistence().findByGroupId_First(groupId, orderByComparator);
266            }
267    
268            /**
269            * Finds the last team in the ordered set where groupId = &#63;.
270            *
271            * <p>
272            * 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.
273            * </p>
274            *
275            * @param groupId the group ID to search with
276            * @param orderByComparator the comparator to order the set by
277            * @return the last matching team
278            * @throws com.liferay.portal.NoSuchTeamException if a matching team could not be found
279            * @throws SystemException if a system exception occurred
280            */
281            public static com.liferay.portal.model.Team findByGroupId_Last(
282                    long groupId,
283                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
284                    throws com.liferay.portal.NoSuchTeamException,
285                            com.liferay.portal.kernel.exception.SystemException {
286                    return getPersistence().findByGroupId_Last(groupId, orderByComparator);
287            }
288    
289            /**
290            * Finds the teams before and after the current team in the ordered set where groupId = &#63;.
291            *
292            * <p>
293            * 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.
294            * </p>
295            *
296            * @param teamId the primary key of the current team
297            * @param groupId the group ID to search with
298            * @param orderByComparator the comparator to order the set by
299            * @return the previous, current, and next team
300            * @throws com.liferay.portal.NoSuchTeamException if a team with the primary key could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public static com.liferay.portal.model.Team[] findByGroupId_PrevAndNext(
304                    long teamId, long groupId,
305                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
306                    throws com.liferay.portal.NoSuchTeamException,
307                            com.liferay.portal.kernel.exception.SystemException {
308                    return getPersistence()
309                                       .findByGroupId_PrevAndNext(teamId, groupId, orderByComparator);
310            }
311    
312            /**
313            * Filters by the user's permissions and finds all the teams where groupId = &#63;.
314            *
315            * @param groupId the group ID to search with
316            * @return the matching teams that the user has permission to view
317            * @throws SystemException if a system exception occurred
318            */
319            public static java.util.List<com.liferay.portal.model.Team> filterFindByGroupId(
320                    long groupId)
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getPersistence().filterFindByGroupId(groupId);
323            }
324    
325            /**
326            * Filters by the user's permissions and finds a range of all the teams where groupId = &#63;.
327            *
328            * <p>
329            * 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.
330            * </p>
331            *
332            * @param groupId the group ID to search with
333            * @param start the lower bound of the range of teams to return
334            * @param end the upper bound of the range of teams to return (not inclusive)
335            * @return the range of matching teams that the user has permission to view
336            * @throws SystemException if a system exception occurred
337            */
338            public static java.util.List<com.liferay.portal.model.Team> filterFindByGroupId(
339                    long groupId, int start, int end)
340                    throws com.liferay.portal.kernel.exception.SystemException {
341                    return getPersistence().filterFindByGroupId(groupId, start, end);
342            }
343    
344            /**
345            * Filters by the user's permissions and finds an ordered range of all the teams where groupId = &#63;.
346            *
347            * <p>
348            * 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.
349            * </p>
350            *
351            * @param groupId the group ID to search with
352            * @param start the lower bound of the range of teams to return
353            * @param end the upper bound of the range of teams to return (not inclusive)
354            * @param orderByComparator the comparator to order the results by
355            * @return the ordered range of matching teams that the user has permission to view
356            * @throws SystemException if a system exception occurred
357            */
358            public static java.util.List<com.liferay.portal.model.Team> filterFindByGroupId(
359                    long groupId, int start, int end,
360                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getPersistence()
363                                       .filterFindByGroupId(groupId, start, end, orderByComparator);
364            }
365    
366            /**
367            * Filters the teams before and after the current team in the ordered set where groupId = &#63;.
368            *
369            * <p>
370            * 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.
371            * </p>
372            *
373            * @param teamId the primary key of the current team
374            * @param groupId the group ID to search with
375            * @param orderByComparator the comparator to order the set by
376            * @return the previous, current, and next team
377            * @throws com.liferay.portal.NoSuchTeamException if a team with the primary key could not be found
378            * @throws SystemException if a system exception occurred
379            */
380            public static com.liferay.portal.model.Team[] filterFindByGroupId_PrevAndNext(
381                    long teamId, long groupId,
382                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
383                    throws com.liferay.portal.NoSuchTeamException,
384                            com.liferay.portal.kernel.exception.SystemException {
385                    return getPersistence()
386                                       .filterFindByGroupId_PrevAndNext(teamId, groupId,
387                            orderByComparator);
388            }
389    
390            /**
391            * Finds the team where groupId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchTeamException} if it could not be found.
392            *
393            * @param groupId the group ID to search with
394            * @param name the name to search with
395            * @return the matching team
396            * @throws com.liferay.portal.NoSuchTeamException if a matching team could not be found
397            * @throws SystemException if a system exception occurred
398            */
399            public static com.liferay.portal.model.Team findByG_N(long groupId,
400                    java.lang.String name)
401                    throws com.liferay.portal.NoSuchTeamException,
402                            com.liferay.portal.kernel.exception.SystemException {
403                    return getPersistence().findByG_N(groupId, name);
404            }
405    
406            /**
407            * Finds the team where groupId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
408            *
409            * @param groupId the group ID to search with
410            * @param name the name to search with
411            * @return the matching team, or <code>null</code> if a matching team could not be found
412            * @throws SystemException if a system exception occurred
413            */
414            public static com.liferay.portal.model.Team fetchByG_N(long groupId,
415                    java.lang.String name)
416                    throws com.liferay.portal.kernel.exception.SystemException {
417                    return getPersistence().fetchByG_N(groupId, name);
418            }
419    
420            /**
421            * Finds the team where groupId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
422            *
423            * @param groupId the group ID to search with
424            * @param name the name to search with
425            * @return the matching team, or <code>null</code> if a matching team could not be found
426            * @throws SystemException if a system exception occurred
427            */
428            public static com.liferay.portal.model.Team fetchByG_N(long groupId,
429                    java.lang.String name, boolean retrieveFromCache)
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    return getPersistence().fetchByG_N(groupId, name, retrieveFromCache);
432            }
433    
434            /**
435            * Finds all the teams.
436            *
437            * @return the teams
438            * @throws SystemException if a system exception occurred
439            */
440            public static java.util.List<com.liferay.portal.model.Team> findAll()
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    return getPersistence().findAll();
443            }
444    
445            /**
446            * Finds a range of all the teams.
447            *
448            * <p>
449            * 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.
450            * </p>
451            *
452            * @param start the lower bound of the range of teams to return
453            * @param end the upper bound of the range of teams to return (not inclusive)
454            * @return the range of teams
455            * @throws SystemException if a system exception occurred
456            */
457            public static java.util.List<com.liferay.portal.model.Team> findAll(
458                    int start, int end)
459                    throws com.liferay.portal.kernel.exception.SystemException {
460                    return getPersistence().findAll(start, end);
461            }
462    
463            /**
464            * Finds an ordered range of all the teams.
465            *
466            * <p>
467            * 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.
468            * </p>
469            *
470            * @param start the lower bound of the range of teams to return
471            * @param end the upper bound of the range of teams to return (not inclusive)
472            * @param orderByComparator the comparator to order the results by
473            * @return the ordered range of teams
474            * @throws SystemException if a system exception occurred
475            */
476            public static java.util.List<com.liferay.portal.model.Team> findAll(
477                    int start, int end,
478                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
479                    throws com.liferay.portal.kernel.exception.SystemException {
480                    return getPersistence().findAll(start, end, orderByComparator);
481            }
482    
483            /**
484            * Removes all the teams where groupId = &#63; from the database.
485            *
486            * @param groupId the group ID to search with
487            * @throws SystemException if a system exception occurred
488            */
489            public static void removeByGroupId(long groupId)
490                    throws com.liferay.portal.kernel.exception.SystemException {
491                    getPersistence().removeByGroupId(groupId);
492            }
493    
494            /**
495            * Removes the team where groupId = &#63; and name = &#63; from the database.
496            *
497            * @param groupId the group ID to search with
498            * @param name the name to search with
499            * @throws SystemException if a system exception occurred
500            */
501            public static void removeByG_N(long groupId, java.lang.String name)
502                    throws com.liferay.portal.NoSuchTeamException,
503                            com.liferay.portal.kernel.exception.SystemException {
504                    getPersistence().removeByG_N(groupId, name);
505            }
506    
507            /**
508            * Removes all the teams from the database.
509            *
510            * @throws SystemException if a system exception occurred
511            */
512            public static void removeAll()
513                    throws com.liferay.portal.kernel.exception.SystemException {
514                    getPersistence().removeAll();
515            }
516    
517            /**
518            * Counts all the teams where groupId = &#63;.
519            *
520            * @param groupId the group ID to search with
521            * @return the number of matching teams
522            * @throws SystemException if a system exception occurred
523            */
524            public static int countByGroupId(long groupId)
525                    throws com.liferay.portal.kernel.exception.SystemException {
526                    return getPersistence().countByGroupId(groupId);
527            }
528    
529            /**
530            * Filters by the user's permissions and counts all the teams where groupId = &#63;.
531            *
532            * @param groupId the group ID to search with
533            * @return the number of matching teams that the user has permission to view
534            * @throws SystemException if a system exception occurred
535            */
536            public static int filterCountByGroupId(long groupId)
537                    throws com.liferay.portal.kernel.exception.SystemException {
538                    return getPersistence().filterCountByGroupId(groupId);
539            }
540    
541            /**
542            * Counts all the teams where groupId = &#63; and name = &#63;.
543            *
544            * @param groupId the group ID to search with
545            * @param name the name to search with
546            * @return the number of matching teams
547            * @throws SystemException if a system exception occurred
548            */
549            public static int countByG_N(long groupId, java.lang.String name)
550                    throws com.liferay.portal.kernel.exception.SystemException {
551                    return getPersistence().countByG_N(groupId, name);
552            }
553    
554            /**
555            * Counts all the teams.
556            *
557            * @return the number of teams
558            * @throws SystemException if a system exception occurred
559            */
560            public static int countAll()
561                    throws com.liferay.portal.kernel.exception.SystemException {
562                    return getPersistence().countAll();
563            }
564    
565            /**
566            * Gets all the users associated with the team.
567            *
568            * @param pk the primary key of the team to get the associated users for
569            * @return the users associated with the team
570            * @throws SystemException if a system exception occurred
571            */
572            public static java.util.List<com.liferay.portal.model.User> getUsers(
573                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
574                    return getPersistence().getUsers(pk);
575            }
576    
577            /**
578            * Gets a range of all the users associated with the team.
579            *
580            * <p>
581            * 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.
582            * </p>
583            *
584            * @param pk the primary key of the team to get the associated users for
585            * @param start the lower bound of the range of teams to return
586            * @param end the upper bound of the range of teams to return (not inclusive)
587            * @return the range of users associated with the team
588            * @throws SystemException if a system exception occurred
589            */
590            public static java.util.List<com.liferay.portal.model.User> getUsers(
591                    long pk, int start, int end)
592                    throws com.liferay.portal.kernel.exception.SystemException {
593                    return getPersistence().getUsers(pk, start, end);
594            }
595    
596            /**
597            * Gets an ordered range of all the users associated with the team.
598            *
599            * <p>
600            * 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.
601            * </p>
602            *
603            * @param pk the primary key of the team to get the associated users for
604            * @param start the lower bound of the range of teams to return
605            * @param end the upper bound of the range of teams to return (not inclusive)
606            * @param orderByComparator the comparator to order the results by
607            * @return the ordered range of users associated with the team
608            * @throws SystemException if a system exception occurred
609            */
610            public static java.util.List<com.liferay.portal.model.User> getUsers(
611                    long pk, int start, int end,
612                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
613                    throws com.liferay.portal.kernel.exception.SystemException {
614                    return getPersistence().getUsers(pk, start, end, orderByComparator);
615            }
616    
617            /**
618            * Gets the number of users associated with the team.
619            *
620            * @param pk the primary key of the team to get the number of associated users for
621            * @return the number of users associated with the team
622            * @throws SystemException if a system exception occurred
623            */
624            public static int getUsersSize(long pk)
625                    throws com.liferay.portal.kernel.exception.SystemException {
626                    return getPersistence().getUsersSize(pk);
627            }
628    
629            /**
630            * Determines if the user is associated with the team.
631            *
632            * @param pk the primary key of the team
633            * @param userPK the primary key of the user
634            * @return <code>true</code> if the user is associated with the team; <code>false</code> otherwise
635            * @throws SystemException if a system exception occurred
636            */
637            public static boolean containsUser(long pk, long userPK)
638                    throws com.liferay.portal.kernel.exception.SystemException {
639                    return getPersistence().containsUser(pk, userPK);
640            }
641    
642            /**
643            * Determines if the team has any users associated with it.
644            *
645            * @param pk the primary key of the team to check for associations with users
646            * @return <code>true</code> if the team has any users associated with it; <code>false</code> otherwise
647            * @throws SystemException if a system exception occurred
648            */
649            public static boolean containsUsers(long pk)
650                    throws com.liferay.portal.kernel.exception.SystemException {
651                    return getPersistence().containsUsers(pk);
652            }
653    
654            /**
655            * Adds an association between the team and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
656            *
657            * @param pk the primary key of the team
658            * @param userPK the primary key of the user
659            * @throws SystemException if a system exception occurred
660            */
661            public static void addUser(long pk, long userPK)
662                    throws com.liferay.portal.kernel.exception.SystemException {
663                    getPersistence().addUser(pk, userPK);
664            }
665    
666            /**
667            * Adds an association between the team and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
668            *
669            * @param pk the primary key of the team
670            * @param user the user
671            * @throws SystemException if a system exception occurred
672            */
673            public static void addUser(long pk, com.liferay.portal.model.User user)
674                    throws com.liferay.portal.kernel.exception.SystemException {
675                    getPersistence().addUser(pk, user);
676            }
677    
678            /**
679            * Adds an association between the team and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
680            *
681            * @param pk the primary key of the team
682            * @param userPKs the primary keys of the users
683            * @throws SystemException if a system exception occurred
684            */
685            public static void addUsers(long pk, long[] userPKs)
686                    throws com.liferay.portal.kernel.exception.SystemException {
687                    getPersistence().addUsers(pk, userPKs);
688            }
689    
690            /**
691            * Adds an association between the team and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
692            *
693            * @param pk the primary key of the team
694            * @param users the users
695            * @throws SystemException if a system exception occurred
696            */
697            public static void addUsers(long pk,
698                    java.util.List<com.liferay.portal.model.User> users)
699                    throws com.liferay.portal.kernel.exception.SystemException {
700                    getPersistence().addUsers(pk, users);
701            }
702    
703            /**
704            * Clears all associations between the team and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
705            *
706            * @param pk the primary key of the team to clear the associated users from
707            * @throws SystemException if a system exception occurred
708            */
709            public static void clearUsers(long pk)
710                    throws com.liferay.portal.kernel.exception.SystemException {
711                    getPersistence().clearUsers(pk);
712            }
713    
714            /**
715            * Removes the association between the team and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
716            *
717            * @param pk the primary key of the team
718            * @param userPK the primary key of the user
719            * @throws SystemException if a system exception occurred
720            */
721            public static void removeUser(long pk, long userPK)
722                    throws com.liferay.portal.kernel.exception.SystemException {
723                    getPersistence().removeUser(pk, userPK);
724            }
725    
726            /**
727            * Removes the association between the team and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
728            *
729            * @param pk the primary key of the team
730            * @param user the user
731            * @throws SystemException if a system exception occurred
732            */
733            public static void removeUser(long pk, com.liferay.portal.model.User user)
734                    throws com.liferay.portal.kernel.exception.SystemException {
735                    getPersistence().removeUser(pk, user);
736            }
737    
738            /**
739            * Removes the association between the team and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
740            *
741            * @param pk the primary key of the team
742            * @param userPKs the primary keys of the users
743            * @throws SystemException if a system exception occurred
744            */
745            public static void removeUsers(long pk, long[] userPKs)
746                    throws com.liferay.portal.kernel.exception.SystemException {
747                    getPersistence().removeUsers(pk, userPKs);
748            }
749    
750            /**
751            * Removes the association between the team and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
752            *
753            * @param pk the primary key of the team
754            * @param users the users
755            * @throws SystemException if a system exception occurred
756            */
757            public static void removeUsers(long pk,
758                    java.util.List<com.liferay.portal.model.User> users)
759                    throws com.liferay.portal.kernel.exception.SystemException {
760                    getPersistence().removeUsers(pk, users);
761            }
762    
763            /**
764            * Sets the users associated with the team, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
765            *
766            * @param pk the primary key of the team to set the associations for
767            * @param userPKs the primary keys of the users to be associated with the team
768            * @throws SystemException if a system exception occurred
769            */
770            public static void setUsers(long pk, long[] userPKs)
771                    throws com.liferay.portal.kernel.exception.SystemException {
772                    getPersistence().setUsers(pk, userPKs);
773            }
774    
775            /**
776            * Sets the users associated with the team, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
777            *
778            * @param pk the primary key of the team to set the associations for
779            * @param users the users to be associated with the team
780            * @throws SystemException if a system exception occurred
781            */
782            public static void setUsers(long pk,
783                    java.util.List<com.liferay.portal.model.User> users)
784                    throws com.liferay.portal.kernel.exception.SystemException {
785                    getPersistence().setUsers(pk, users);
786            }
787    
788            /**
789            * Gets all the user groups associated with the team.
790            *
791            * @param pk the primary key of the team to get the associated user groups for
792            * @return the user groups associated with the team
793            * @throws SystemException if a system exception occurred
794            */
795            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
796                    long pk) throws com.liferay.portal.kernel.exception.SystemException {
797                    return getPersistence().getUserGroups(pk);
798            }
799    
800            /**
801            * Gets a range of all the user groups associated with the team.
802            *
803            * <p>
804            * 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.
805            * </p>
806            *
807            * @param pk the primary key of the team to get the associated user groups for
808            * @param start the lower bound of the range of teams to return
809            * @param end the upper bound of the range of teams to return (not inclusive)
810            * @return the range of user groups associated with the team
811            * @throws SystemException if a system exception occurred
812            */
813            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
814                    long pk, int start, int end)
815                    throws com.liferay.portal.kernel.exception.SystemException {
816                    return getPersistence().getUserGroups(pk, start, end);
817            }
818    
819            /**
820            * Gets an ordered range of all the user groups associated with the team.
821            *
822            * <p>
823            * 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.
824            * </p>
825            *
826            * @param pk the primary key of the team to get the associated user groups for
827            * @param start the lower bound of the range of teams to return
828            * @param end the upper bound of the range of teams to return (not inclusive)
829            * @param orderByComparator the comparator to order the results by
830            * @return the ordered range of user groups associated with the team
831            * @throws SystemException if a system exception occurred
832            */
833            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
834                    long pk, int start, int end,
835                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
836                    throws com.liferay.portal.kernel.exception.SystemException {
837                    return getPersistence().getUserGroups(pk, start, end, orderByComparator);
838            }
839    
840            /**
841            * Gets the number of user groups associated with the team.
842            *
843            * @param pk the primary key of the team to get the number of associated user groups for
844            * @return the number of user groups associated with the team
845            * @throws SystemException if a system exception occurred
846            */
847            public static int getUserGroupsSize(long pk)
848                    throws com.liferay.portal.kernel.exception.SystemException {
849                    return getPersistence().getUserGroupsSize(pk);
850            }
851    
852            /**
853            * Determines if the user group is associated with the team.
854            *
855            * @param pk the primary key of the team
856            * @param userGroupPK the primary key of the user group
857            * @return <code>true</code> if the user group is associated with the team; <code>false</code> otherwise
858            * @throws SystemException if a system exception occurred
859            */
860            public static boolean containsUserGroup(long pk, long userGroupPK)
861                    throws com.liferay.portal.kernel.exception.SystemException {
862                    return getPersistence().containsUserGroup(pk, userGroupPK);
863            }
864    
865            /**
866            * Determines if the team has any user groups associated with it.
867            *
868            * @param pk the primary key of the team to check for associations with user groups
869            * @return <code>true</code> if the team has any user groups associated with it; <code>false</code> otherwise
870            * @throws SystemException if a system exception occurred
871            */
872            public static boolean containsUserGroups(long pk)
873                    throws com.liferay.portal.kernel.exception.SystemException {
874                    return getPersistence().containsUserGroups(pk);
875            }
876    
877            /**
878            * Adds an association between the team and the user group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
879            *
880            * @param pk the primary key of the team
881            * @param userGroupPK the primary key of the user group
882            * @throws SystemException if a system exception occurred
883            */
884            public static void addUserGroup(long pk, long userGroupPK)
885                    throws com.liferay.portal.kernel.exception.SystemException {
886                    getPersistence().addUserGroup(pk, userGroupPK);
887            }
888    
889            /**
890            * Adds an association between the team and the user group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
891            *
892            * @param pk the primary key of the team
893            * @param userGroup the user group
894            * @throws SystemException if a system exception occurred
895            */
896            public static void addUserGroup(long pk,
897                    com.liferay.portal.model.UserGroup userGroup)
898                    throws com.liferay.portal.kernel.exception.SystemException {
899                    getPersistence().addUserGroup(pk, userGroup);
900            }
901    
902            /**
903            * Adds an association between the team and the user groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
904            *
905            * @param pk the primary key of the team
906            * @param userGroupPKs the primary keys of the user groups
907            * @throws SystemException if a system exception occurred
908            */
909            public static void addUserGroups(long pk, long[] userGroupPKs)
910                    throws com.liferay.portal.kernel.exception.SystemException {
911                    getPersistence().addUserGroups(pk, userGroupPKs);
912            }
913    
914            /**
915            * Adds an association between the team and the user groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
916            *
917            * @param pk the primary key of the team
918            * @param userGroups the user groups
919            * @throws SystemException if a system exception occurred
920            */
921            public static void addUserGroups(long pk,
922                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
923                    throws com.liferay.portal.kernel.exception.SystemException {
924                    getPersistence().addUserGroups(pk, userGroups);
925            }
926    
927            /**
928            * Clears all associations between the team and its user groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
929            *
930            * @param pk the primary key of the team to clear the associated user groups from
931            * @throws SystemException if a system exception occurred
932            */
933            public static void clearUserGroups(long pk)
934                    throws com.liferay.portal.kernel.exception.SystemException {
935                    getPersistence().clearUserGroups(pk);
936            }
937    
938            /**
939            * Removes the association between the team and the user group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
940            *
941            * @param pk the primary key of the team
942            * @param userGroupPK the primary key of the user group
943            * @throws SystemException if a system exception occurred
944            */
945            public static void removeUserGroup(long pk, long userGroupPK)
946                    throws com.liferay.portal.kernel.exception.SystemException {
947                    getPersistence().removeUserGroup(pk, userGroupPK);
948            }
949    
950            /**
951            * Removes the association between the team and the user group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
952            *
953            * @param pk the primary key of the team
954            * @param userGroup the user group
955            * @throws SystemException if a system exception occurred
956            */
957            public static void removeUserGroup(long pk,
958                    com.liferay.portal.model.UserGroup userGroup)
959                    throws com.liferay.portal.kernel.exception.SystemException {
960                    getPersistence().removeUserGroup(pk, userGroup);
961            }
962    
963            /**
964            * Removes the association between the team and the user groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
965            *
966            * @param pk the primary key of the team
967            * @param userGroupPKs the primary keys of the user groups
968            * @throws SystemException if a system exception occurred
969            */
970            public static void removeUserGroups(long pk, long[] userGroupPKs)
971                    throws com.liferay.portal.kernel.exception.SystemException {
972                    getPersistence().removeUserGroups(pk, userGroupPKs);
973            }
974    
975            /**
976            * Removes the association between the team and the user groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
977            *
978            * @param pk the primary key of the team
979            * @param userGroups the user groups
980            * @throws SystemException if a system exception occurred
981            */
982            public static void removeUserGroups(long pk,
983                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
984                    throws com.liferay.portal.kernel.exception.SystemException {
985                    getPersistence().removeUserGroups(pk, userGroups);
986            }
987    
988            /**
989            * Sets the user groups associated with the team, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
990            *
991            * @param pk the primary key of the team to set the associations for
992            * @param userGroupPKs the primary keys of the user groups to be associated with the team
993            * @throws SystemException if a system exception occurred
994            */
995            public static void setUserGroups(long pk, long[] userGroupPKs)
996                    throws com.liferay.portal.kernel.exception.SystemException {
997                    getPersistence().setUserGroups(pk, userGroupPKs);
998            }
999    
1000            /**
1001            * Sets the user groups associated with the team, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1002            *
1003            * @param pk the primary key of the team to set the associations for
1004            * @param userGroups the user groups to be associated with the team
1005            * @throws SystemException if a system exception occurred
1006            */
1007            public static void setUserGroups(long pk,
1008                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
1009                    throws com.liferay.portal.kernel.exception.SystemException {
1010                    getPersistence().setUserGroups(pk, userGroups);
1011            }
1012    
1013            public static TeamPersistence getPersistence() {
1014                    if (_persistence == null) {
1015                            _persistence = (TeamPersistence)PortalBeanLocatorUtil.locate(TeamPersistence.class.getName());
1016    
1017                            ReferenceRegistry.registerReference(TeamUtil.class, "_persistence");
1018                    }
1019    
1020                    return _persistence;
1021            }
1022    
1023            public void setPersistence(TeamPersistence persistence) {
1024                    _persistence = persistence;
1025    
1026                    ReferenceRegistry.registerReference(TeamUtil.class, "_persistence");
1027            }
1028    
1029            private static TeamPersistence _persistence;
1030    }