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