001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.exception.PortalException;
032    import com.liferay.portal.kernel.exception.SystemException;
033    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
034    import com.liferay.portal.kernel.search.Indexable;
035    import com.liferay.portal.kernel.search.IndexableType;
036    import com.liferay.portal.kernel.util.OrderByComparator;
037    import com.liferay.portal.model.PersistedModel;
038    import com.liferay.portal.model.Team;
039    import com.liferay.portal.service.BaseLocalServiceImpl;
040    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
041    import com.liferay.portal.service.TeamLocalService;
042    import com.liferay.portal.service.persistence.RoleFinder;
043    import com.liferay.portal.service.persistence.RolePersistence;
044    import com.liferay.portal.service.persistence.TeamFinder;
045    import com.liferay.portal.service.persistence.TeamPersistence;
046    import com.liferay.portal.service.persistence.UserFinder;
047    import com.liferay.portal.service.persistence.UserGroupFinder;
048    import com.liferay.portal.service.persistence.UserGroupPersistence;
049    import com.liferay.portal.service.persistence.UserPersistence;
050    import com.liferay.portal.util.PortalUtil;
051    
052    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
053    import com.liferay.portlet.exportimport.lar.ManifestSummary;
054    import com.liferay.portlet.exportimport.lar.PortletDataContext;
055    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
056    import com.liferay.portlet.exportimport.lar.StagedModelType;
057    
058    import java.io.Serializable;
059    
060    import java.util.List;
061    
062    import javax.sql.DataSource;
063    
064    /**
065     * Provides the base implementation for the team local service.
066     *
067     * <p>
068     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portal.service.impl.TeamLocalServiceImpl}.
069     * </p>
070     *
071     * @author Brian Wing Shun Chan
072     * @see com.liferay.portal.service.impl.TeamLocalServiceImpl
073     * @see com.liferay.portal.service.TeamLocalServiceUtil
074     * @generated
075     */
076    @ProviderType
077    public abstract class TeamLocalServiceBaseImpl extends BaseLocalServiceImpl
078            implements TeamLocalService, IdentifiableOSGiService {
079            /*
080             * NOTE FOR DEVELOPERS:
081             *
082             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.TeamLocalServiceUtil} to access the team local service.
083             */
084    
085            /**
086             * Adds the team to the database. Also notifies the appropriate model listeners.
087             *
088             * @param team the team
089             * @return the team that was added
090             */
091            @Indexable(type = IndexableType.REINDEX)
092            @Override
093            public Team addTeam(Team team) {
094                    team.setNew(true);
095    
096                    return teamPersistence.update(team);
097            }
098    
099            /**
100             * Creates a new team with the primary key. Does not add the team to the database.
101             *
102             * @param teamId the primary key for the new team
103             * @return the new team
104             */
105            @Override
106            public Team createTeam(long teamId) {
107                    return teamPersistence.create(teamId);
108            }
109    
110            /**
111             * Deletes the team with the primary key from the database. Also notifies the appropriate model listeners.
112             *
113             * @param teamId the primary key of the team
114             * @return the team that was removed
115             * @throws PortalException if a team with the primary key could not be found
116             */
117            @Indexable(type = IndexableType.DELETE)
118            @Override
119            public Team deleteTeam(long teamId) throws PortalException {
120                    return teamPersistence.remove(teamId);
121            }
122    
123            /**
124             * Deletes the team from the database. Also notifies the appropriate model listeners.
125             *
126             * @param team the team
127             * @return the team that was removed
128             * @throws PortalException
129             */
130            @Indexable(type = IndexableType.DELETE)
131            @Override
132            public Team deleteTeam(Team team) throws PortalException {
133                    return teamPersistence.remove(team);
134            }
135    
136            @Override
137            public DynamicQuery dynamicQuery() {
138                    Class<?> clazz = getClass();
139    
140                    return DynamicQueryFactoryUtil.forClass(Team.class,
141                            clazz.getClassLoader());
142            }
143    
144            /**
145             * Performs a dynamic query on the database and returns the matching rows.
146             *
147             * @param dynamicQuery the dynamic query
148             * @return the matching rows
149             */
150            @Override
151            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
152                    return teamPersistence.findWithDynamicQuery(dynamicQuery);
153            }
154    
155            /**
156             * Performs a dynamic query on the database and returns a range of the matching rows.
157             *
158             * <p>
159             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TeamModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
160             * </p>
161             *
162             * @param dynamicQuery the dynamic query
163             * @param start the lower bound of the range of model instances
164             * @param end the upper bound of the range of model instances (not inclusive)
165             * @return the range of matching rows
166             */
167            @Override
168            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
169                    int end) {
170                    return teamPersistence.findWithDynamicQuery(dynamicQuery, start, end);
171            }
172    
173            /**
174             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
175             *
176             * <p>
177             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TeamModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
178             * </p>
179             *
180             * @param dynamicQuery the dynamic query
181             * @param start the lower bound of the range of model instances
182             * @param end the upper bound of the range of model instances (not inclusive)
183             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
184             * @return the ordered range of matching rows
185             */
186            @Override
187            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
188                    int end, OrderByComparator<T> orderByComparator) {
189                    return teamPersistence.findWithDynamicQuery(dynamicQuery, start, end,
190                            orderByComparator);
191            }
192    
193            /**
194             * Returns the number of rows matching the dynamic query.
195             *
196             * @param dynamicQuery the dynamic query
197             * @return the number of rows matching the dynamic query
198             */
199            @Override
200            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
201                    return teamPersistence.countWithDynamicQuery(dynamicQuery);
202            }
203    
204            /**
205             * Returns the number of rows matching the dynamic query.
206             *
207             * @param dynamicQuery the dynamic query
208             * @param projection the projection to apply to the query
209             * @return the number of rows matching the dynamic query
210             */
211            @Override
212            public long dynamicQueryCount(DynamicQuery dynamicQuery,
213                    Projection projection) {
214                    return teamPersistence.countWithDynamicQuery(dynamicQuery, projection);
215            }
216    
217            @Override
218            public Team fetchTeam(long teamId) {
219                    return teamPersistence.fetchByPrimaryKey(teamId);
220            }
221    
222            /**
223             * Returns the team matching the UUID and group.
224             *
225             * @param uuid the team's UUID
226             * @param groupId the primary key of the group
227             * @return the matching team, or <code>null</code> if a matching team could not be found
228             */
229            @Override
230            public Team fetchTeamByUuidAndGroupId(String uuid, long groupId) {
231                    return teamPersistence.fetchByUUID_G(uuid, groupId);
232            }
233    
234            /**
235             * Returns the team with the primary key.
236             *
237             * @param teamId the primary key of the team
238             * @return the team
239             * @throws PortalException if a team with the primary key could not be found
240             */
241            @Override
242            public Team getTeam(long teamId) throws PortalException {
243                    return teamPersistence.findByPrimaryKey(teamId);
244            }
245    
246            @Override
247            public ActionableDynamicQuery getActionableDynamicQuery() {
248                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
249    
250                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.TeamLocalServiceUtil.getService());
251                    actionableDynamicQuery.setClassLoader(getClassLoader());
252                    actionableDynamicQuery.setModelClass(Team.class);
253    
254                    actionableDynamicQuery.setPrimaryKeyPropertyName("teamId");
255    
256                    return actionableDynamicQuery;
257            }
258    
259            @Override
260            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
261                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
262    
263                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.TeamLocalServiceUtil.getService());
264                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
265                    indexableActionableDynamicQuery.setModelClass(Team.class);
266    
267                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("teamId");
268    
269                    return indexableActionableDynamicQuery;
270            }
271    
272            protected void initActionableDynamicQuery(
273                    ActionableDynamicQuery actionableDynamicQuery) {
274                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.TeamLocalServiceUtil.getService());
275                    actionableDynamicQuery.setClassLoader(getClassLoader());
276                    actionableDynamicQuery.setModelClass(Team.class);
277    
278                    actionableDynamicQuery.setPrimaryKeyPropertyName("teamId");
279            }
280    
281            @Override
282            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
283                    final PortletDataContext portletDataContext) {
284                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
285                                    @Override
286                                    public long performCount() throws PortalException {
287                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
288    
289                                            StagedModelType stagedModelType = getStagedModelType();
290    
291                                            long modelAdditionCount = super.performCount();
292    
293                                            manifestSummary.addModelAdditionCount(stagedModelType,
294                                                    modelAdditionCount);
295    
296                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
297                                                            stagedModelType);
298    
299                                            manifestSummary.addModelDeletionCount(stagedModelType,
300                                                    modelDeletionCount);
301    
302                                            return modelAdditionCount;
303                                    }
304                            };
305    
306                    initActionableDynamicQuery(exportActionableDynamicQuery);
307    
308                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
309                                    @Override
310                                    public void addCriteria(DynamicQuery dynamicQuery) {
311                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
312                                                    "modifiedDate");
313                                    }
314                            });
315    
316                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
317    
318                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
319    
320                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Team>() {
321                                    @Override
322                                    public void performAction(Team team) throws PortalException {
323                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
324                                                    team);
325                                    }
326                            });
327                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
328                                    PortalUtil.getClassNameId(Team.class.getName())));
329    
330                    return exportActionableDynamicQuery;
331            }
332    
333            /**
334             * @throws PortalException
335             */
336            @Override
337            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
338                    throws PortalException {
339                    return teamLocalService.deleteTeam((Team)persistedModel);
340            }
341    
342            @Override
343            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
344                    throws PortalException {
345                    return teamPersistence.findByPrimaryKey(primaryKeyObj);
346            }
347    
348            /**
349             * Returns all the teams matching the UUID and company.
350             *
351             * @param uuid the UUID of the teams
352             * @param companyId the primary key of the company
353             * @return the matching teams, or an empty list if no matches were found
354             */
355            @Override
356            public List<Team> getTeamsByUuidAndCompanyId(String uuid, long companyId) {
357                    return teamPersistence.findByUuid_C(uuid, companyId);
358            }
359    
360            /**
361             * Returns a range of teams matching the UUID and company.
362             *
363             * @param uuid the UUID of the teams
364             * @param companyId the primary key of the company
365             * @param start the lower bound of the range of teams
366             * @param end the upper bound of the range of teams (not inclusive)
367             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
368             * @return the range of matching teams, or an empty list if no matches were found
369             */
370            @Override
371            public List<Team> getTeamsByUuidAndCompanyId(String uuid, long companyId,
372                    int start, int end, OrderByComparator<Team> orderByComparator) {
373                    return teamPersistence.findByUuid_C(uuid, companyId, start, end,
374                            orderByComparator);
375            }
376    
377            /**
378             * Returns the team matching the UUID and group.
379             *
380             * @param uuid the team's UUID
381             * @param groupId the primary key of the group
382             * @return the matching team
383             * @throws PortalException if a matching team could not be found
384             */
385            @Override
386            public Team getTeamByUuidAndGroupId(String uuid, long groupId)
387                    throws PortalException {
388                    return teamPersistence.findByUUID_G(uuid, groupId);
389            }
390    
391            /**
392             * Returns a range of all the teams.
393             *
394             * <p>
395             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TeamModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
396             * </p>
397             *
398             * @param start the lower bound of the range of teams
399             * @param end the upper bound of the range of teams (not inclusive)
400             * @return the range of teams
401             */
402            @Override
403            public List<Team> getTeams(int start, int end) {
404                    return teamPersistence.findAll(start, end);
405            }
406    
407            /**
408             * Returns the number of teams.
409             *
410             * @return the number of teams
411             */
412            @Override
413            public int getTeamsCount() {
414                    return teamPersistence.countAll();
415            }
416    
417            /**
418             * Updates the team in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
419             *
420             * @param team the team
421             * @return the team that was updated
422             */
423            @Indexable(type = IndexableType.REINDEX)
424            @Override
425            public Team updateTeam(Team team) {
426                    return teamPersistence.update(team);
427            }
428    
429            /**
430             */
431            @Override
432            public void addUserTeam(long userId, long teamId) {
433                    userPersistence.addTeam(userId, teamId);
434            }
435    
436            /**
437             */
438            @Override
439            public void addUserTeam(long userId, Team team) {
440                    userPersistence.addTeam(userId, team);
441            }
442    
443            /**
444             */
445            @Override
446            public void addUserTeams(long userId, long[] teamIds) {
447                    userPersistence.addTeams(userId, teamIds);
448            }
449    
450            /**
451             */
452            @Override
453            public void addUserTeams(long userId, List<Team> Teams) {
454                    userPersistence.addTeams(userId, Teams);
455            }
456    
457            /**
458             */
459            @Override
460            public void clearUserTeams(long userId) {
461                    userPersistence.clearTeams(userId);
462            }
463    
464            /**
465             */
466            @Override
467            public void deleteUserTeam(long userId, long teamId) {
468                    userPersistence.removeTeam(userId, teamId);
469            }
470    
471            /**
472             */
473            @Override
474            public void deleteUserTeam(long userId, Team team) {
475                    userPersistence.removeTeam(userId, team);
476            }
477    
478            /**
479             */
480            @Override
481            public void deleteUserTeams(long userId, long[] teamIds) {
482                    userPersistence.removeTeams(userId, teamIds);
483            }
484    
485            /**
486             */
487            @Override
488            public void deleteUserTeams(long userId, List<Team> Teams) {
489                    userPersistence.removeTeams(userId, Teams);
490            }
491    
492            /**
493             * Returns the userIds of the users associated with the team.
494             *
495             * @param teamId the teamId of the team
496             * @return long[] the userIds of users associated with the team
497             */
498            @Override
499            public long[] getUserPrimaryKeys(long teamId) {
500                    return teamPersistence.getUserPrimaryKeys(teamId);
501            }
502    
503            /**
504             */
505            @Override
506            public List<Team> getUserTeams(long userId) {
507                    return userPersistence.getTeams(userId);
508            }
509    
510            /**
511             */
512            @Override
513            public List<Team> getUserTeams(long userId, int start, int end) {
514                    return userPersistence.getTeams(userId, start, end);
515            }
516    
517            /**
518             */
519            @Override
520            public List<Team> getUserTeams(long userId, int start, int end,
521                    OrderByComparator<Team> orderByComparator) {
522                    return userPersistence.getTeams(userId, start, end, orderByComparator);
523            }
524    
525            /**
526             */
527            @Override
528            public int getUserTeamsCount(long userId) {
529                    return userPersistence.getTeamsSize(userId);
530            }
531    
532            /**
533             */
534            @Override
535            public boolean hasUserTeam(long userId, long teamId) {
536                    return userPersistence.containsTeam(userId, teamId);
537            }
538    
539            /**
540             */
541            @Override
542            public boolean hasUserTeams(long userId) {
543                    return userPersistence.containsTeams(userId);
544            }
545    
546            /**
547             */
548            @Override
549            public void setUserTeams(long userId, long[] teamIds) {
550                    userPersistence.setTeams(userId, teamIds);
551            }
552    
553            /**
554             */
555            @Override
556            public void addUserGroupTeam(long userGroupId, long teamId) {
557                    userGroupPersistence.addTeam(userGroupId, teamId);
558            }
559    
560            /**
561             */
562            @Override
563            public void addUserGroupTeam(long userGroupId, Team team) {
564                    userGroupPersistence.addTeam(userGroupId, team);
565            }
566    
567            /**
568             */
569            @Override
570            public void addUserGroupTeams(long userGroupId, long[] teamIds) {
571                    userGroupPersistence.addTeams(userGroupId, teamIds);
572            }
573    
574            /**
575             */
576            @Override
577            public void addUserGroupTeams(long userGroupId, List<Team> Teams) {
578                    userGroupPersistence.addTeams(userGroupId, Teams);
579            }
580    
581            /**
582             */
583            @Override
584            public void clearUserGroupTeams(long userGroupId) {
585                    userGroupPersistence.clearTeams(userGroupId);
586            }
587    
588            /**
589             */
590            @Override
591            public void deleteUserGroupTeam(long userGroupId, long teamId) {
592                    userGroupPersistence.removeTeam(userGroupId, teamId);
593            }
594    
595            /**
596             */
597            @Override
598            public void deleteUserGroupTeam(long userGroupId, Team team) {
599                    userGroupPersistence.removeTeam(userGroupId, team);
600            }
601    
602            /**
603             */
604            @Override
605            public void deleteUserGroupTeams(long userGroupId, long[] teamIds) {
606                    userGroupPersistence.removeTeams(userGroupId, teamIds);
607            }
608    
609            /**
610             */
611            @Override
612            public void deleteUserGroupTeams(long userGroupId, List<Team> Teams) {
613                    userGroupPersistence.removeTeams(userGroupId, Teams);
614            }
615    
616            /**
617             * Returns the userGroupIds of the user groups associated with the team.
618             *
619             * @param teamId the teamId of the team
620             * @return long[] the userGroupIds of user groups associated with the team
621             */
622            @Override
623            public long[] getUserGroupPrimaryKeys(long teamId) {
624                    return teamPersistence.getUserGroupPrimaryKeys(teamId);
625            }
626    
627            /**
628             */
629            @Override
630            public List<Team> getUserGroupTeams(long userGroupId) {
631                    return userGroupPersistence.getTeams(userGroupId);
632            }
633    
634            /**
635             */
636            @Override
637            public List<Team> getUserGroupTeams(long userGroupId, int start, int end) {
638                    return userGroupPersistence.getTeams(userGroupId, start, end);
639            }
640    
641            /**
642             */
643            @Override
644            public List<Team> getUserGroupTeams(long userGroupId, int start, int end,
645                    OrderByComparator<Team> orderByComparator) {
646                    return userGroupPersistence.getTeams(userGroupId, start, end,
647                            orderByComparator);
648            }
649    
650            /**
651             */
652            @Override
653            public int getUserGroupTeamsCount(long userGroupId) {
654                    return userGroupPersistence.getTeamsSize(userGroupId);
655            }
656    
657            /**
658             */
659            @Override
660            public boolean hasUserGroupTeam(long userGroupId, long teamId) {
661                    return userGroupPersistence.containsTeam(userGroupId, teamId);
662            }
663    
664            /**
665             */
666            @Override
667            public boolean hasUserGroupTeams(long userGroupId) {
668                    return userGroupPersistence.containsTeams(userGroupId);
669            }
670    
671            /**
672             */
673            @Override
674            public void setUserGroupTeams(long userGroupId, long[] teamIds) {
675                    userGroupPersistence.setTeams(userGroupId, teamIds);
676            }
677    
678            /**
679             * Returns the team local service.
680             *
681             * @return the team local service
682             */
683            public TeamLocalService getTeamLocalService() {
684                    return teamLocalService;
685            }
686    
687            /**
688             * Sets the team local service.
689             *
690             * @param teamLocalService the team local service
691             */
692            public void setTeamLocalService(TeamLocalService teamLocalService) {
693                    this.teamLocalService = teamLocalService;
694            }
695    
696            /**
697             * Returns the team persistence.
698             *
699             * @return the team persistence
700             */
701            public TeamPersistence getTeamPersistence() {
702                    return teamPersistence;
703            }
704    
705            /**
706             * Sets the team persistence.
707             *
708             * @param teamPersistence the team persistence
709             */
710            public void setTeamPersistence(TeamPersistence teamPersistence) {
711                    this.teamPersistence = teamPersistence;
712            }
713    
714            /**
715             * Returns the team finder.
716             *
717             * @return the team finder
718             */
719            public TeamFinder getTeamFinder() {
720                    return teamFinder;
721            }
722    
723            /**
724             * Sets the team finder.
725             *
726             * @param teamFinder the team finder
727             */
728            public void setTeamFinder(TeamFinder teamFinder) {
729                    this.teamFinder = teamFinder;
730            }
731    
732            /**
733             * Returns the counter local service.
734             *
735             * @return the counter local service
736             */
737            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
738                    return counterLocalService;
739            }
740    
741            /**
742             * Sets the counter local service.
743             *
744             * @param counterLocalService the counter local service
745             */
746            public void setCounterLocalService(
747                    com.liferay.counter.service.CounterLocalService counterLocalService) {
748                    this.counterLocalService = counterLocalService;
749            }
750    
751            /**
752             * Returns the resource local service.
753             *
754             * @return the resource local service
755             */
756            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
757                    return resourceLocalService;
758            }
759    
760            /**
761             * Sets the resource local service.
762             *
763             * @param resourceLocalService the resource local service
764             */
765            public void setResourceLocalService(
766                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
767                    this.resourceLocalService = resourceLocalService;
768            }
769    
770            /**
771             * Returns the role local service.
772             *
773             * @return the role local service
774             */
775            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
776                    return roleLocalService;
777            }
778    
779            /**
780             * Sets the role local service.
781             *
782             * @param roleLocalService the role local service
783             */
784            public void setRoleLocalService(
785                    com.liferay.portal.service.RoleLocalService roleLocalService) {
786                    this.roleLocalService = roleLocalService;
787            }
788    
789            /**
790             * Returns the role persistence.
791             *
792             * @return the role persistence
793             */
794            public RolePersistence getRolePersistence() {
795                    return rolePersistence;
796            }
797    
798            /**
799             * Sets the role persistence.
800             *
801             * @param rolePersistence the role persistence
802             */
803            public void setRolePersistence(RolePersistence rolePersistence) {
804                    this.rolePersistence = rolePersistence;
805            }
806    
807            /**
808             * Returns the role finder.
809             *
810             * @return the role finder
811             */
812            public RoleFinder getRoleFinder() {
813                    return roleFinder;
814            }
815    
816            /**
817             * Sets the role finder.
818             *
819             * @param roleFinder the role finder
820             */
821            public void setRoleFinder(RoleFinder roleFinder) {
822                    this.roleFinder = roleFinder;
823            }
824    
825            /**
826             * Returns the user local service.
827             *
828             * @return the user local service
829             */
830            public com.liferay.portal.service.UserLocalService getUserLocalService() {
831                    return userLocalService;
832            }
833    
834            /**
835             * Sets the user local service.
836             *
837             * @param userLocalService the user local service
838             */
839            public void setUserLocalService(
840                    com.liferay.portal.service.UserLocalService userLocalService) {
841                    this.userLocalService = userLocalService;
842            }
843    
844            /**
845             * Returns the user persistence.
846             *
847             * @return the user persistence
848             */
849            public UserPersistence getUserPersistence() {
850                    return userPersistence;
851            }
852    
853            /**
854             * Sets the user persistence.
855             *
856             * @param userPersistence the user persistence
857             */
858            public void setUserPersistence(UserPersistence userPersistence) {
859                    this.userPersistence = userPersistence;
860            }
861    
862            /**
863             * Returns the user finder.
864             *
865             * @return the user finder
866             */
867            public UserFinder getUserFinder() {
868                    return userFinder;
869            }
870    
871            /**
872             * Sets the user finder.
873             *
874             * @param userFinder the user finder
875             */
876            public void setUserFinder(UserFinder userFinder) {
877                    this.userFinder = userFinder;
878            }
879    
880            /**
881             * Returns the user group local service.
882             *
883             * @return the user group local service
884             */
885            public com.liferay.portal.service.UserGroupLocalService getUserGroupLocalService() {
886                    return userGroupLocalService;
887            }
888    
889            /**
890             * Sets the user group local service.
891             *
892             * @param userGroupLocalService the user group local service
893             */
894            public void setUserGroupLocalService(
895                    com.liferay.portal.service.UserGroupLocalService userGroupLocalService) {
896                    this.userGroupLocalService = userGroupLocalService;
897            }
898    
899            /**
900             * Returns the user group persistence.
901             *
902             * @return the user group persistence
903             */
904            public UserGroupPersistence getUserGroupPersistence() {
905                    return userGroupPersistence;
906            }
907    
908            /**
909             * Sets the user group persistence.
910             *
911             * @param userGroupPersistence the user group persistence
912             */
913            public void setUserGroupPersistence(
914                    UserGroupPersistence userGroupPersistence) {
915                    this.userGroupPersistence = userGroupPersistence;
916            }
917    
918            /**
919             * Returns the user group finder.
920             *
921             * @return the user group finder
922             */
923            public UserGroupFinder getUserGroupFinder() {
924                    return userGroupFinder;
925            }
926    
927            /**
928             * Sets the user group finder.
929             *
930             * @param userGroupFinder the user group finder
931             */
932            public void setUserGroupFinder(UserGroupFinder userGroupFinder) {
933                    this.userGroupFinder = userGroupFinder;
934            }
935    
936            public void afterPropertiesSet() {
937                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Team",
938                            teamLocalService);
939            }
940    
941            public void destroy() {
942                    persistedModelLocalServiceRegistry.unregister(
943                            "com.liferay.portal.model.Team");
944            }
945    
946            /**
947             * Returns the OSGi service identifier.
948             *
949             * @return the OSGi service identifier
950             */
951            @Override
952            public String getOSGiServiceIdentifier() {
953                    return TeamLocalService.class.getName();
954            }
955    
956            protected Class<?> getModelClass() {
957                    return Team.class;
958            }
959    
960            protected String getModelClassName() {
961                    return Team.class.getName();
962            }
963    
964            /**
965             * Performs a SQL query.
966             *
967             * @param sql the sql query
968             */
969            protected void runSQL(String sql) {
970                    try {
971                            DataSource dataSource = teamPersistence.getDataSource();
972    
973                            DB db = DBManagerUtil.getDB();
974    
975                            sql = db.buildSQL(sql);
976                            sql = PortalUtil.transformSQL(sql);
977    
978                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
979                                            sql, new int[0]);
980    
981                            sqlUpdate.update();
982                    }
983                    catch (Exception e) {
984                            throw new SystemException(e);
985                    }
986            }
987    
988            @BeanReference(type = com.liferay.portal.service.TeamLocalService.class)
989            protected TeamLocalService teamLocalService;
990            @BeanReference(type = TeamPersistence.class)
991            protected TeamPersistence teamPersistence;
992            @BeanReference(type = TeamFinder.class)
993            protected TeamFinder teamFinder;
994            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
995            protected com.liferay.counter.service.CounterLocalService counterLocalService;
996            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
997            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
998            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
999            protected com.liferay.portal.service.RoleLocalService roleLocalService;
1000            @BeanReference(type = RolePersistence.class)
1001            protected RolePersistence rolePersistence;
1002            @BeanReference(type = RoleFinder.class)
1003            protected RoleFinder roleFinder;
1004            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1005            protected com.liferay.portal.service.UserLocalService userLocalService;
1006            @BeanReference(type = UserPersistence.class)
1007            protected UserPersistence userPersistence;
1008            @BeanReference(type = UserFinder.class)
1009            protected UserFinder userFinder;
1010            @BeanReference(type = com.liferay.portal.service.UserGroupLocalService.class)
1011            protected com.liferay.portal.service.UserGroupLocalService userGroupLocalService;
1012            @BeanReference(type = UserGroupPersistence.class)
1013            protected UserGroupPersistence userGroupPersistence;
1014            @BeanReference(type = UserGroupFinder.class)
1015            protected UserGroupFinder userGroupFinder;
1016            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1017            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1018    }