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 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(TeamLocalService teamLocalService) {
565                    this.teamLocalService = teamLocalService;
566            }
567    
568            /**
569             * Returns the team remote service.
570             *
571             * @return the team remote service
572             */
573            public com.liferay.portal.service.TeamService getTeamService() {
574                    return teamService;
575            }
576    
577            /**
578             * Sets the team remote service.
579             *
580             * @param teamService the team remote service
581             */
582            public void setTeamService(
583                    com.liferay.portal.service.TeamService teamService) {
584                    this.teamService = teamService;
585            }
586    
587            /**
588             * Returns the team persistence.
589             *
590             * @return the team persistence
591             */
592            public TeamPersistence getTeamPersistence() {
593                    return teamPersistence;
594            }
595    
596            /**
597             * Sets the team persistence.
598             *
599             * @param teamPersistence the team persistence
600             */
601            public void setTeamPersistence(TeamPersistence teamPersistence) {
602                    this.teamPersistence = teamPersistence;
603            }
604    
605            /**
606             * Returns the team finder.
607             *
608             * @return the team finder
609             */
610            public TeamFinder getTeamFinder() {
611                    return teamFinder;
612            }
613    
614            /**
615             * Sets the team finder.
616             *
617             * @param teamFinder the team finder
618             */
619            public void setTeamFinder(TeamFinder teamFinder) {
620                    this.teamFinder = teamFinder;
621            }
622    
623            /**
624             * Returns the counter local service.
625             *
626             * @return the counter local service
627             */
628            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
629                    return counterLocalService;
630            }
631    
632            /**
633             * Sets the counter local service.
634             *
635             * @param counterLocalService the counter local service
636             */
637            public void setCounterLocalService(
638                    com.liferay.counter.service.CounterLocalService counterLocalService) {
639                    this.counterLocalService = counterLocalService;
640            }
641    
642            /**
643             * Returns the resource local service.
644             *
645             * @return the resource local service
646             */
647            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
648                    return resourceLocalService;
649            }
650    
651            /**
652             * Sets the resource local service.
653             *
654             * @param resourceLocalService the resource local service
655             */
656            public void setResourceLocalService(
657                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
658                    this.resourceLocalService = resourceLocalService;
659            }
660    
661            /**
662             * Returns the role local service.
663             *
664             * @return the role local service
665             */
666            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
667                    return roleLocalService;
668            }
669    
670            /**
671             * Sets the role local service.
672             *
673             * @param roleLocalService the role local service
674             */
675            public void setRoleLocalService(
676                    com.liferay.portal.service.RoleLocalService roleLocalService) {
677                    this.roleLocalService = roleLocalService;
678            }
679    
680            /**
681             * Returns the role remote service.
682             *
683             * @return the role remote service
684             */
685            public com.liferay.portal.service.RoleService getRoleService() {
686                    return roleService;
687            }
688    
689            /**
690             * Sets the role remote service.
691             *
692             * @param roleService the role remote service
693             */
694            public void setRoleService(
695                    com.liferay.portal.service.RoleService roleService) {
696                    this.roleService = roleService;
697            }
698    
699            /**
700             * Returns the role persistence.
701             *
702             * @return the role persistence
703             */
704            public RolePersistence getRolePersistence() {
705                    return rolePersistence;
706            }
707    
708            /**
709             * Sets the role persistence.
710             *
711             * @param rolePersistence the role persistence
712             */
713            public void setRolePersistence(RolePersistence rolePersistence) {
714                    this.rolePersistence = rolePersistence;
715            }
716    
717            /**
718             * Returns the role finder.
719             *
720             * @return the role finder
721             */
722            public RoleFinder getRoleFinder() {
723                    return roleFinder;
724            }
725    
726            /**
727             * Sets the role finder.
728             *
729             * @param roleFinder the role finder
730             */
731            public void setRoleFinder(RoleFinder roleFinder) {
732                    this.roleFinder = roleFinder;
733            }
734    
735            /**
736             * Returns the user local service.
737             *
738             * @return the user local service
739             */
740            public com.liferay.portal.service.UserLocalService getUserLocalService() {
741                    return userLocalService;
742            }
743    
744            /**
745             * Sets the user local service.
746             *
747             * @param userLocalService the user local service
748             */
749            public void setUserLocalService(
750                    com.liferay.portal.service.UserLocalService userLocalService) {
751                    this.userLocalService = userLocalService;
752            }
753    
754            /**
755             * Returns the user remote service.
756             *
757             * @return the user remote service
758             */
759            public com.liferay.portal.service.UserService getUserService() {
760                    return userService;
761            }
762    
763            /**
764             * Sets the user remote service.
765             *
766             * @param userService the user remote service
767             */
768            public void setUserService(
769                    com.liferay.portal.service.UserService userService) {
770                    this.userService = userService;
771            }
772    
773            /**
774             * Returns the user persistence.
775             *
776             * @return the user persistence
777             */
778            public UserPersistence getUserPersistence() {
779                    return userPersistence;
780            }
781    
782            /**
783             * Sets the user persistence.
784             *
785             * @param userPersistence the user persistence
786             */
787            public void setUserPersistence(UserPersistence userPersistence) {
788                    this.userPersistence = userPersistence;
789            }
790    
791            /**
792             * Returns the user finder.
793             *
794             * @return the user finder
795             */
796            public UserFinder getUserFinder() {
797                    return userFinder;
798            }
799    
800            /**
801             * Sets the user finder.
802             *
803             * @param userFinder the user finder
804             */
805            public void setUserFinder(UserFinder userFinder) {
806                    this.userFinder = userFinder;
807            }
808    
809            /**
810             * Returns the user group local service.
811             *
812             * @return the user group local service
813             */
814            public com.liferay.portal.service.UserGroupLocalService getUserGroupLocalService() {
815                    return userGroupLocalService;
816            }
817    
818            /**
819             * Sets the user group local service.
820             *
821             * @param userGroupLocalService the user group local service
822             */
823            public void setUserGroupLocalService(
824                    com.liferay.portal.service.UserGroupLocalService userGroupLocalService) {
825                    this.userGroupLocalService = userGroupLocalService;
826            }
827    
828            /**
829             * Returns the user group remote service.
830             *
831             * @return the user group remote service
832             */
833            public com.liferay.portal.service.UserGroupService getUserGroupService() {
834                    return userGroupService;
835            }
836    
837            /**
838             * Sets the user group remote service.
839             *
840             * @param userGroupService the user group remote service
841             */
842            public void setUserGroupService(
843                    com.liferay.portal.service.UserGroupService userGroupService) {
844                    this.userGroupService = userGroupService;
845            }
846    
847            /**
848             * Returns the user group persistence.
849             *
850             * @return the user group persistence
851             */
852            public UserGroupPersistence getUserGroupPersistence() {
853                    return userGroupPersistence;
854            }
855    
856            /**
857             * Sets the user group persistence.
858             *
859             * @param userGroupPersistence the user group persistence
860             */
861            public void setUserGroupPersistence(
862                    UserGroupPersistence userGroupPersistence) {
863                    this.userGroupPersistence = userGroupPersistence;
864            }
865    
866            /**
867             * Returns the user group finder.
868             *
869             * @return the user group finder
870             */
871            public UserGroupFinder getUserGroupFinder() {
872                    return userGroupFinder;
873            }
874    
875            /**
876             * Sets the user group finder.
877             *
878             * @param userGroupFinder the user group finder
879             */
880            public void setUserGroupFinder(UserGroupFinder userGroupFinder) {
881                    this.userGroupFinder = userGroupFinder;
882            }
883    
884            public void afterPropertiesSet() {
885                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Team",
886                            teamLocalService);
887            }
888    
889            public void destroy() {
890                    persistedModelLocalServiceRegistry.unregister(
891                            "com.liferay.portal.model.Team");
892            }
893    
894            /**
895             * Returns the Spring bean ID for this bean.
896             *
897             * @return the Spring bean ID for this bean
898             */
899            @Override
900            public String getBeanIdentifier() {
901                    return _beanIdentifier;
902            }
903    
904            /**
905             * Sets the Spring bean ID for this bean.
906             *
907             * @param beanIdentifier the Spring bean ID for this bean
908             */
909            @Override
910            public void setBeanIdentifier(String beanIdentifier) {
911                    _beanIdentifier = beanIdentifier;
912            }
913    
914            protected Class<?> getModelClass() {
915                    return Team.class;
916            }
917    
918            protected String getModelClassName() {
919                    return Team.class.getName();
920            }
921    
922            /**
923             * Performs a SQL query.
924             *
925             * @param sql the sql query
926             */
927            protected void runSQL(String sql) {
928                    try {
929                            DataSource dataSource = teamPersistence.getDataSource();
930    
931                            DB db = DBFactoryUtil.getDB();
932    
933                            sql = db.buildSQL(sql);
934                            sql = PortalUtil.transformSQL(sql);
935    
936                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
937                                            sql, new int[0]);
938    
939                            sqlUpdate.update();
940                    }
941                    catch (Exception e) {
942                            throw new SystemException(e);
943                    }
944            }
945    
946            @BeanReference(type = TeamLocalService.class)
947            protected TeamLocalService teamLocalService;
948            @BeanReference(type = com.liferay.portal.service.TeamService.class)
949            protected com.liferay.portal.service.TeamService teamService;
950            @BeanReference(type = TeamPersistence.class)
951            protected TeamPersistence teamPersistence;
952            @BeanReference(type = TeamFinder.class)
953            protected TeamFinder teamFinder;
954            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
955            protected com.liferay.counter.service.CounterLocalService counterLocalService;
956            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
957            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
958            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
959            protected com.liferay.portal.service.RoleLocalService roleLocalService;
960            @BeanReference(type = com.liferay.portal.service.RoleService.class)
961            protected com.liferay.portal.service.RoleService roleService;
962            @BeanReference(type = RolePersistence.class)
963            protected RolePersistence rolePersistence;
964            @BeanReference(type = RoleFinder.class)
965            protected RoleFinder roleFinder;
966            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
967            protected com.liferay.portal.service.UserLocalService userLocalService;
968            @BeanReference(type = com.liferay.portal.service.UserService.class)
969            protected com.liferay.portal.service.UserService userService;
970            @BeanReference(type = UserPersistence.class)
971            protected UserPersistence userPersistence;
972            @BeanReference(type = UserFinder.class)
973            protected UserFinder userFinder;
974            @BeanReference(type = com.liferay.portal.service.UserGroupLocalService.class)
975            protected com.liferay.portal.service.UserGroupLocalService userGroupLocalService;
976            @BeanReference(type = com.liferay.portal.service.UserGroupService.class)
977            protected com.liferay.portal.service.UserGroupService userGroupService;
978            @BeanReference(type = UserGroupPersistence.class)
979            protected UserGroupPersistence userGroupPersistence;
980            @BeanReference(type = UserGroupFinder.class)
981            protected UserGroupFinder userGroupFinder;
982            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
983            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
984            private String _beanIdentifier;
985    }