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.portlet.messageboards.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.service.BaseServiceImpl;
025    import com.liferay.portal.service.persistence.SystemEventPersistence;
026    import com.liferay.portal.service.persistence.UserFinder;
027    import com.liferay.portal.service.persistence.UserPersistence;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import com.liferay.portlet.messageboards.model.MBBan;
031    import com.liferay.portlet.messageboards.service.MBBanService;
032    import com.liferay.portlet.messageboards.service.persistence.MBBanPersistence;
033    
034    import javax.sql.DataSource;
035    
036    /**
037     * Provides the base implementation for the message boards ban remote service.
038     *
039     * <p>
040     * 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.portlet.messageboards.service.impl.MBBanServiceImpl}.
041     * </p>
042     *
043     * @author Brian Wing Shun Chan
044     * @see com.liferay.portlet.messageboards.service.impl.MBBanServiceImpl
045     * @see com.liferay.portlet.messageboards.service.MBBanServiceUtil
046     * @generated
047     */
048    public abstract class MBBanServiceBaseImpl extends BaseServiceImpl
049            implements MBBanService, IdentifiableBean {
050            /*
051             * NOTE FOR DEVELOPERS:
052             *
053             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.messageboards.service.MBBanServiceUtil} to access the message boards ban remote service.
054             */
055    
056            /**
057             * Returns the message boards ban local service.
058             *
059             * @return the message boards ban local service
060             */
061            public com.liferay.portlet.messageboards.service.MBBanLocalService getMBBanLocalService() {
062                    return mbBanLocalService;
063            }
064    
065            /**
066             * Sets the message boards ban local service.
067             *
068             * @param mbBanLocalService the message boards ban local service
069             */
070            public void setMBBanLocalService(
071                    com.liferay.portlet.messageboards.service.MBBanLocalService mbBanLocalService) {
072                    this.mbBanLocalService = mbBanLocalService;
073            }
074    
075            /**
076             * Returns the message boards ban remote service.
077             *
078             * @return the message boards ban remote service
079             */
080            public com.liferay.portlet.messageboards.service.MBBanService getMBBanService() {
081                    return mbBanService;
082            }
083    
084            /**
085             * Sets the message boards ban remote service.
086             *
087             * @param mbBanService the message boards ban remote service
088             */
089            public void setMBBanService(
090                    com.liferay.portlet.messageboards.service.MBBanService mbBanService) {
091                    this.mbBanService = mbBanService;
092            }
093    
094            /**
095             * Returns the message boards ban persistence.
096             *
097             * @return the message boards ban persistence
098             */
099            public MBBanPersistence getMBBanPersistence() {
100                    return mbBanPersistence;
101            }
102    
103            /**
104             * Sets the message boards ban persistence.
105             *
106             * @param mbBanPersistence the message boards ban persistence
107             */
108            public void setMBBanPersistence(MBBanPersistence mbBanPersistence) {
109                    this.mbBanPersistence = mbBanPersistence;
110            }
111    
112            /**
113             * Returns the counter local service.
114             *
115             * @return the counter local service
116             */
117            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
118                    return counterLocalService;
119            }
120    
121            /**
122             * Sets the counter local service.
123             *
124             * @param counterLocalService the counter local service
125             */
126            public void setCounterLocalService(
127                    com.liferay.counter.service.CounterLocalService counterLocalService) {
128                    this.counterLocalService = counterLocalService;
129            }
130    
131            /**
132             * Returns the system event local service.
133             *
134             * @return the system event local service
135             */
136            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
137                    return systemEventLocalService;
138            }
139    
140            /**
141             * Sets the system event local service.
142             *
143             * @param systemEventLocalService the system event local service
144             */
145            public void setSystemEventLocalService(
146                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
147                    this.systemEventLocalService = systemEventLocalService;
148            }
149    
150            /**
151             * Returns the system event persistence.
152             *
153             * @return the system event persistence
154             */
155            public SystemEventPersistence getSystemEventPersistence() {
156                    return systemEventPersistence;
157            }
158    
159            /**
160             * Sets the system event persistence.
161             *
162             * @param systemEventPersistence the system event persistence
163             */
164            public void setSystemEventPersistence(
165                    SystemEventPersistence systemEventPersistence) {
166                    this.systemEventPersistence = systemEventPersistence;
167            }
168    
169            /**
170             * Returns the user local service.
171             *
172             * @return the user local service
173             */
174            public com.liferay.portal.service.UserLocalService getUserLocalService() {
175                    return userLocalService;
176            }
177    
178            /**
179             * Sets the user local service.
180             *
181             * @param userLocalService the user local service
182             */
183            public void setUserLocalService(
184                    com.liferay.portal.service.UserLocalService userLocalService) {
185                    this.userLocalService = userLocalService;
186            }
187    
188            /**
189             * Returns the user remote service.
190             *
191             * @return the user remote service
192             */
193            public com.liferay.portal.service.UserService getUserService() {
194                    return userService;
195            }
196    
197            /**
198             * Sets the user remote service.
199             *
200             * @param userService the user remote service
201             */
202            public void setUserService(
203                    com.liferay.portal.service.UserService userService) {
204                    this.userService = userService;
205            }
206    
207            /**
208             * Returns the user persistence.
209             *
210             * @return the user persistence
211             */
212            public UserPersistence getUserPersistence() {
213                    return userPersistence;
214            }
215    
216            /**
217             * Sets the user persistence.
218             *
219             * @param userPersistence the user persistence
220             */
221            public void setUserPersistence(UserPersistence userPersistence) {
222                    this.userPersistence = userPersistence;
223            }
224    
225            /**
226             * Returns the user finder.
227             *
228             * @return the user finder
229             */
230            public UserFinder getUserFinder() {
231                    return userFinder;
232            }
233    
234            /**
235             * Sets the user finder.
236             *
237             * @param userFinder the user finder
238             */
239            public void setUserFinder(UserFinder userFinder) {
240                    this.userFinder = userFinder;
241            }
242    
243            public void afterPropertiesSet() {
244            }
245    
246            public void destroy() {
247            }
248    
249            /**
250             * Returns the Spring bean ID for this bean.
251             *
252             * @return the Spring bean ID for this bean
253             */
254            @Override
255            public String getBeanIdentifier() {
256                    return _beanIdentifier;
257            }
258    
259            /**
260             * Sets the Spring bean ID for this bean.
261             *
262             * @param beanIdentifier the Spring bean ID for this bean
263             */
264            @Override
265            public void setBeanIdentifier(String beanIdentifier) {
266                    _beanIdentifier = beanIdentifier;
267            }
268    
269            protected Class<?> getModelClass() {
270                    return MBBan.class;
271            }
272    
273            protected String getModelClassName() {
274                    return MBBan.class.getName();
275            }
276    
277            /**
278             * Performs a SQL query.
279             *
280             * @param sql the sql query
281             */
282            protected void runSQL(String sql) {
283                    try {
284                            DataSource dataSource = mbBanPersistence.getDataSource();
285    
286                            DB db = DBFactoryUtil.getDB();
287    
288                            sql = db.buildSQL(sql);
289                            sql = PortalUtil.transformSQL(sql);
290    
291                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
292                                            sql, new int[0]);
293    
294                            sqlUpdate.update();
295                    }
296                    catch (Exception e) {
297                            throw new SystemException(e);
298                    }
299            }
300    
301            @BeanReference(type = com.liferay.portlet.messageboards.service.MBBanLocalService.class)
302            protected com.liferay.portlet.messageboards.service.MBBanLocalService mbBanLocalService;
303            @BeanReference(type = com.liferay.portlet.messageboards.service.MBBanService.class)
304            protected com.liferay.portlet.messageboards.service.MBBanService mbBanService;
305            @BeanReference(type = MBBanPersistence.class)
306            protected MBBanPersistence mbBanPersistence;
307            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
308            protected com.liferay.counter.service.CounterLocalService counterLocalService;
309            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
310            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
311            @BeanReference(type = SystemEventPersistence.class)
312            protected SystemEventPersistence systemEventPersistence;
313            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
314            protected com.liferay.portal.service.UserLocalService userLocalService;
315            @BeanReference(type = com.liferay.portal.service.UserService.class)
316            protected com.liferay.portal.service.UserService userService;
317            @BeanReference(type = UserPersistence.class)
318            protected UserPersistence userPersistence;
319            @BeanReference(type = UserFinder.class)
320            protected UserFinder userFinder;
321            private String _beanIdentifier;
322    }