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 com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.exception.SystemException;
024    import com.liferay.portal.model.BackgroundTask;
025    import com.liferay.portal.service.BackgroundTaskService;
026    import com.liferay.portal.service.BaseServiceImpl;
027    import com.liferay.portal.service.persistence.BackgroundTaskPersistence;
028    import com.liferay.portal.service.persistence.UserFinder;
029    import com.liferay.portal.service.persistence.UserPersistence;
030    import com.liferay.portal.util.PortalUtil;
031    
032    import javax.sql.DataSource;
033    
034    /**
035     * Provides the base implementation for the background task remote service.
036     *
037     * <p>
038     * 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.BackgroundTaskServiceImpl}.
039     * </p>
040     *
041     * @author Brian Wing Shun Chan
042     * @see com.liferay.portal.service.impl.BackgroundTaskServiceImpl
043     * @see com.liferay.portal.service.BackgroundTaskServiceUtil
044     * @generated
045     */
046    public abstract class BackgroundTaskServiceBaseImpl extends BaseServiceImpl
047            implements BackgroundTaskService, IdentifiableBean {
048            /*
049             * NOTE FOR DEVELOPERS:
050             *
051             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.BackgroundTaskServiceUtil} to access the background task remote service.
052             */
053    
054            /**
055             * Returns the background task local service.
056             *
057             * @return the background task local service
058             */
059            public com.liferay.portal.service.BackgroundTaskLocalService getBackgroundTaskLocalService() {
060                    return backgroundTaskLocalService;
061            }
062    
063            /**
064             * Sets the background task local service.
065             *
066             * @param backgroundTaskLocalService the background task local service
067             */
068            public void setBackgroundTaskLocalService(
069                    com.liferay.portal.service.BackgroundTaskLocalService backgroundTaskLocalService) {
070                    this.backgroundTaskLocalService = backgroundTaskLocalService;
071            }
072    
073            /**
074             * Returns the background task remote service.
075             *
076             * @return the background task remote service
077             */
078            public BackgroundTaskService getBackgroundTaskService() {
079                    return backgroundTaskService;
080            }
081    
082            /**
083             * Sets the background task remote service.
084             *
085             * @param backgroundTaskService the background task remote service
086             */
087            public void setBackgroundTaskService(
088                    BackgroundTaskService backgroundTaskService) {
089                    this.backgroundTaskService = backgroundTaskService;
090            }
091    
092            /**
093             * Returns the background task persistence.
094             *
095             * @return the background task persistence
096             */
097            public BackgroundTaskPersistence getBackgroundTaskPersistence() {
098                    return backgroundTaskPersistence;
099            }
100    
101            /**
102             * Sets the background task persistence.
103             *
104             * @param backgroundTaskPersistence the background task persistence
105             */
106            public void setBackgroundTaskPersistence(
107                    BackgroundTaskPersistence backgroundTaskPersistence) {
108                    this.backgroundTaskPersistence = backgroundTaskPersistence;
109            }
110    
111            /**
112             * Returns the counter local service.
113             *
114             * @return the counter local service
115             */
116            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
117                    return counterLocalService;
118            }
119    
120            /**
121             * Sets the counter local service.
122             *
123             * @param counterLocalService the counter local service
124             */
125            public void setCounterLocalService(
126                    com.liferay.counter.service.CounterLocalService counterLocalService) {
127                    this.counterLocalService = counterLocalService;
128            }
129    
130            /**
131             * Returns the user local service.
132             *
133             * @return the user local service
134             */
135            public com.liferay.portal.service.UserLocalService getUserLocalService() {
136                    return userLocalService;
137            }
138    
139            /**
140             * Sets the user local service.
141             *
142             * @param userLocalService the user local service
143             */
144            public void setUserLocalService(
145                    com.liferay.portal.service.UserLocalService userLocalService) {
146                    this.userLocalService = userLocalService;
147            }
148    
149            /**
150             * Returns the user remote service.
151             *
152             * @return the user remote service
153             */
154            public com.liferay.portal.service.UserService getUserService() {
155                    return userService;
156            }
157    
158            /**
159             * Sets the user remote service.
160             *
161             * @param userService the user remote service
162             */
163            public void setUserService(
164                    com.liferay.portal.service.UserService userService) {
165                    this.userService = userService;
166            }
167    
168            /**
169             * Returns the user persistence.
170             *
171             * @return the user persistence
172             */
173            public UserPersistence getUserPersistence() {
174                    return userPersistence;
175            }
176    
177            /**
178             * Sets the user persistence.
179             *
180             * @param userPersistence the user persistence
181             */
182            public void setUserPersistence(UserPersistence userPersistence) {
183                    this.userPersistence = userPersistence;
184            }
185    
186            /**
187             * Returns the user finder.
188             *
189             * @return the user finder
190             */
191            public UserFinder getUserFinder() {
192                    return userFinder;
193            }
194    
195            /**
196             * Sets the user finder.
197             *
198             * @param userFinder the user finder
199             */
200            public void setUserFinder(UserFinder userFinder) {
201                    this.userFinder = userFinder;
202            }
203    
204            public void afterPropertiesSet() {
205            }
206    
207            public void destroy() {
208            }
209    
210            /**
211             * Returns the Spring bean ID for this bean.
212             *
213             * @return the Spring bean ID for this bean
214             */
215            @Override
216            public String getBeanIdentifier() {
217                    return _beanIdentifier;
218            }
219    
220            /**
221             * Sets the Spring bean ID for this bean.
222             *
223             * @param beanIdentifier the Spring bean ID for this bean
224             */
225            @Override
226            public void setBeanIdentifier(String beanIdentifier) {
227                    _beanIdentifier = beanIdentifier;
228            }
229    
230            protected Class<?> getModelClass() {
231                    return BackgroundTask.class;
232            }
233    
234            protected String getModelClassName() {
235                    return BackgroundTask.class.getName();
236            }
237    
238            /**
239             * Performs a SQL query.
240             *
241             * @param sql the sql query
242             */
243            protected void runSQL(String sql) {
244                    try {
245                            DataSource dataSource = backgroundTaskPersistence.getDataSource();
246    
247                            DB db = DBFactoryUtil.getDB();
248    
249                            sql = db.buildSQL(sql);
250                            sql = PortalUtil.transformSQL(sql);
251    
252                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
253                                            sql, new int[0]);
254    
255                            sqlUpdate.update();
256                    }
257                    catch (Exception e) {
258                            throw new SystemException(e);
259                    }
260            }
261    
262            @BeanReference(type = com.liferay.portal.service.BackgroundTaskLocalService.class)
263            protected com.liferay.portal.service.BackgroundTaskLocalService backgroundTaskLocalService;
264            @BeanReference(type = BackgroundTaskService.class)
265            protected BackgroundTaskService backgroundTaskService;
266            @BeanReference(type = BackgroundTaskPersistence.class)
267            protected BackgroundTaskPersistence backgroundTaskPersistence;
268            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
269            protected com.liferay.counter.service.CounterLocalService counterLocalService;
270            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
271            protected com.liferay.portal.service.UserLocalService userLocalService;
272            @BeanReference(type = com.liferay.portal.service.UserService.class)
273            protected com.liferay.portal.service.UserService userService;
274            @BeanReference(type = UserPersistence.class)
275            protected UserPersistence userPersistence;
276            @BeanReference(type = UserFinder.class)
277            protected UserFinder userFinder;
278            private String _beanIdentifier;
279    }