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