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.dao.db.DB;
019    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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, IdentifiableOSGiService {
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 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(MBBanService mbBanService) {
090                    this.mbBanService = mbBanService;
091            }
092    
093            /**
094             * Returns the message boards ban persistence.
095             *
096             * @return the message boards ban persistence
097             */
098            public MBBanPersistence getMBBanPersistence() {
099                    return mbBanPersistence;
100            }
101    
102            /**
103             * Sets the message boards ban persistence.
104             *
105             * @param mbBanPersistence the message boards ban persistence
106             */
107            public void setMBBanPersistence(MBBanPersistence mbBanPersistence) {
108                    this.mbBanPersistence = mbBanPersistence;
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 system event local service.
132             *
133             * @return the system event local service
134             */
135            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
136                    return systemEventLocalService;
137            }
138    
139            /**
140             * Sets the system event local service.
141             *
142             * @param systemEventLocalService the system event local service
143             */
144            public void setSystemEventLocalService(
145                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
146                    this.systemEventLocalService = systemEventLocalService;
147            }
148    
149            /**
150             * Returns the system event persistence.
151             *
152             * @return the system event persistence
153             */
154            public SystemEventPersistence getSystemEventPersistence() {
155                    return systemEventPersistence;
156            }
157    
158            /**
159             * Sets the system event persistence.
160             *
161             * @param systemEventPersistence the system event persistence
162             */
163            public void setSystemEventPersistence(
164                    SystemEventPersistence systemEventPersistence) {
165                    this.systemEventPersistence = systemEventPersistence;
166            }
167    
168            /**
169             * Returns the user local service.
170             *
171             * @return the user local service
172             */
173            public com.liferay.portal.service.UserLocalService getUserLocalService() {
174                    return userLocalService;
175            }
176    
177            /**
178             * Sets the user local service.
179             *
180             * @param userLocalService the user local service
181             */
182            public void setUserLocalService(
183                    com.liferay.portal.service.UserLocalService userLocalService) {
184                    this.userLocalService = userLocalService;
185            }
186    
187            /**
188             * Returns the user remote service.
189             *
190             * @return the user remote service
191             */
192            public com.liferay.portal.service.UserService getUserService() {
193                    return userService;
194            }
195    
196            /**
197             * Sets the user remote service.
198             *
199             * @param userService the user remote service
200             */
201            public void setUserService(
202                    com.liferay.portal.service.UserService userService) {
203                    this.userService = userService;
204            }
205    
206            /**
207             * Returns the user persistence.
208             *
209             * @return the user persistence
210             */
211            public UserPersistence getUserPersistence() {
212                    return userPersistence;
213            }
214    
215            /**
216             * Sets the user persistence.
217             *
218             * @param userPersistence the user persistence
219             */
220            public void setUserPersistence(UserPersistence userPersistence) {
221                    this.userPersistence = userPersistence;
222            }
223    
224            /**
225             * Returns the user finder.
226             *
227             * @return the user finder
228             */
229            public UserFinder getUserFinder() {
230                    return userFinder;
231            }
232    
233            /**
234             * Sets the user finder.
235             *
236             * @param userFinder the user finder
237             */
238            public void setUserFinder(UserFinder userFinder) {
239                    this.userFinder = userFinder;
240            }
241    
242            public void afterPropertiesSet() {
243            }
244    
245            public void destroy() {
246            }
247    
248            /**
249             * Returns the OSGi service identifier.
250             *
251             * @return the OSGi service identifier
252             */
253            @Override
254            public String getOSGiServiceIdentifier() {
255                    return MBBanService.class.getName();
256            }
257    
258            protected Class<?> getModelClass() {
259                    return MBBan.class;
260            }
261    
262            protected String getModelClassName() {
263                    return MBBan.class.getName();
264            }
265    
266            /**
267             * Performs a SQL query.
268             *
269             * @param sql the sql query
270             */
271            protected void runSQL(String sql) {
272                    try {
273                            DataSource dataSource = mbBanPersistence.getDataSource();
274    
275                            DB db = DBManagerUtil.getDB();
276    
277                            sql = db.buildSQL(sql);
278                            sql = PortalUtil.transformSQL(sql);
279    
280                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
281                                            sql, new int[0]);
282    
283                            sqlUpdate.update();
284                    }
285                    catch (Exception e) {
286                            throw new SystemException(e);
287                    }
288            }
289    
290            @BeanReference(type = com.liferay.portlet.messageboards.service.MBBanLocalService.class)
291            protected com.liferay.portlet.messageboards.service.MBBanLocalService mbBanLocalService;
292            @BeanReference(type = com.liferay.portlet.messageboards.service.MBBanService.class)
293            protected MBBanService mbBanService;
294            @BeanReference(type = MBBanPersistence.class)
295            protected MBBanPersistence mbBanPersistence;
296            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
297            protected com.liferay.counter.service.CounterLocalService counterLocalService;
298            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
299            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
300            @BeanReference(type = SystemEventPersistence.class)
301            protected SystemEventPersistence systemEventPersistence;
302            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
303            protected com.liferay.portal.service.UserLocalService userLocalService;
304            @BeanReference(type = com.liferay.portal.service.UserService.class)
305            protected com.liferay.portal.service.UserService userService;
306            @BeanReference(type = UserPersistence.class)
307            protected UserPersistence userPersistence;
308            @BeanReference(type = UserFinder.class)
309            protected UserFinder userFinder;
310    }