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.mobiledevicerules.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.mobiledevicerules.model.MDRAction;
031    import com.liferay.portlet.mobiledevicerules.service.MDRActionService;
032    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRActionPersistence;
033    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupInstancePersistence;
034    
035    import javax.sql.DataSource;
036    
037    /**
038     * Provides the base implementation for the m d r action remote service.
039     *
040     * <p>
041     * 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.mobiledevicerules.service.impl.MDRActionServiceImpl}.
042     * </p>
043     *
044     * @author Edward C. Han
045     * @see com.liferay.portlet.mobiledevicerules.service.impl.MDRActionServiceImpl
046     * @see com.liferay.portlet.mobiledevicerules.service.MDRActionServiceUtil
047     * @generated
048     */
049    public abstract class MDRActionServiceBaseImpl extends BaseServiceImpl
050            implements MDRActionService, IdentifiableBean {
051            /*
052             * NOTE FOR DEVELOPERS:
053             *
054             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.mobiledevicerules.service.MDRActionServiceUtil} to access the m d r action remote service.
055             */
056    
057            /**
058             * Returns the m d r action local service.
059             *
060             * @return the m d r action local service
061             */
062            public com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService getMDRActionLocalService() {
063                    return mdrActionLocalService;
064            }
065    
066            /**
067             * Sets the m d r action local service.
068             *
069             * @param mdrActionLocalService the m d r action local service
070             */
071            public void setMDRActionLocalService(
072                    com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService) {
073                    this.mdrActionLocalService = mdrActionLocalService;
074            }
075    
076            /**
077             * Returns the m d r action remote service.
078             *
079             * @return the m d r action remote service
080             */
081            public MDRActionService getMDRActionService() {
082                    return mdrActionService;
083            }
084    
085            /**
086             * Sets the m d r action remote service.
087             *
088             * @param mdrActionService the m d r action remote service
089             */
090            public void setMDRActionService(MDRActionService mdrActionService) {
091                    this.mdrActionService = mdrActionService;
092            }
093    
094            /**
095             * Returns the m d r action persistence.
096             *
097             * @return the m d r action persistence
098             */
099            public MDRActionPersistence getMDRActionPersistence() {
100                    return mdrActionPersistence;
101            }
102    
103            /**
104             * Sets the m d r action persistence.
105             *
106             * @param mdrActionPersistence the m d r action persistence
107             */
108            public void setMDRActionPersistence(
109                    MDRActionPersistence mdrActionPersistence) {
110                    this.mdrActionPersistence = mdrActionPersistence;
111            }
112    
113            /**
114             * Returns the counter local service.
115             *
116             * @return the counter local service
117             */
118            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
119                    return counterLocalService;
120            }
121    
122            /**
123             * Sets the counter local service.
124             *
125             * @param counterLocalService the counter local service
126             */
127            public void setCounterLocalService(
128                    com.liferay.counter.service.CounterLocalService counterLocalService) {
129                    this.counterLocalService = counterLocalService;
130            }
131    
132            /**
133             * Returns the system event local service.
134             *
135             * @return the system event local service
136             */
137            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
138                    return systemEventLocalService;
139            }
140    
141            /**
142             * Sets the system event local service.
143             *
144             * @param systemEventLocalService the system event local service
145             */
146            public void setSystemEventLocalService(
147                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
148                    this.systemEventLocalService = systemEventLocalService;
149            }
150    
151            /**
152             * Returns the system event persistence.
153             *
154             * @return the system event persistence
155             */
156            public SystemEventPersistence getSystemEventPersistence() {
157                    return systemEventPersistence;
158            }
159    
160            /**
161             * Sets the system event persistence.
162             *
163             * @param systemEventPersistence the system event persistence
164             */
165            public void setSystemEventPersistence(
166                    SystemEventPersistence systemEventPersistence) {
167                    this.systemEventPersistence = systemEventPersistence;
168            }
169    
170            /**
171             * Returns the user local service.
172             *
173             * @return the user local service
174             */
175            public com.liferay.portal.service.UserLocalService getUserLocalService() {
176                    return userLocalService;
177            }
178    
179            /**
180             * Sets the user local service.
181             *
182             * @param userLocalService the user local service
183             */
184            public void setUserLocalService(
185                    com.liferay.portal.service.UserLocalService userLocalService) {
186                    this.userLocalService = userLocalService;
187            }
188    
189            /**
190             * Returns the user remote service.
191             *
192             * @return the user remote service
193             */
194            public com.liferay.portal.service.UserService getUserService() {
195                    return userService;
196            }
197    
198            /**
199             * Sets the user remote service.
200             *
201             * @param userService the user remote service
202             */
203            public void setUserService(
204                    com.liferay.portal.service.UserService userService) {
205                    this.userService = userService;
206            }
207    
208            /**
209             * Returns the user persistence.
210             *
211             * @return the user persistence
212             */
213            public UserPersistence getUserPersistence() {
214                    return userPersistence;
215            }
216    
217            /**
218             * Sets the user persistence.
219             *
220             * @param userPersistence the user persistence
221             */
222            public void setUserPersistence(UserPersistence userPersistence) {
223                    this.userPersistence = userPersistence;
224            }
225    
226            /**
227             * Returns the user finder.
228             *
229             * @return the user finder
230             */
231            public UserFinder getUserFinder() {
232                    return userFinder;
233            }
234    
235            /**
236             * Sets the user finder.
237             *
238             * @param userFinder the user finder
239             */
240            public void setUserFinder(UserFinder userFinder) {
241                    this.userFinder = userFinder;
242            }
243    
244            /**
245             * Returns the m d r rule group instance local service.
246             *
247             * @return the m d r rule group instance local service
248             */
249            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
250                    return mdrRuleGroupInstanceLocalService;
251            }
252    
253            /**
254             * Sets the m d r rule group instance local service.
255             *
256             * @param mdrRuleGroupInstanceLocalService the m d r rule group instance local service
257             */
258            public void setMDRRuleGroupInstanceLocalService(
259                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
260                    this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
261            }
262    
263            /**
264             * Returns the m d r rule group instance remote service.
265             *
266             * @return the m d r rule group instance remote service
267             */
268            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
269                    return mdrRuleGroupInstanceService;
270            }
271    
272            /**
273             * Sets the m d r rule group instance remote service.
274             *
275             * @param mdrRuleGroupInstanceService the m d r rule group instance remote service
276             */
277            public void setMDRRuleGroupInstanceService(
278                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
279                    this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
280            }
281    
282            /**
283             * Returns the m d r rule group instance persistence.
284             *
285             * @return the m d r rule group instance persistence
286             */
287            public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
288                    return mdrRuleGroupInstancePersistence;
289            }
290    
291            /**
292             * Sets the m d r rule group instance persistence.
293             *
294             * @param mdrRuleGroupInstancePersistence the m d r rule group instance persistence
295             */
296            public void setMDRRuleGroupInstancePersistence(
297                    MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
298                    this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
299            }
300    
301            public void afterPropertiesSet() {
302            }
303    
304            public void destroy() {
305            }
306    
307            /**
308             * Returns the Spring bean ID for this bean.
309             *
310             * @return the Spring bean ID for this bean
311             */
312            @Override
313            public String getBeanIdentifier() {
314                    return _beanIdentifier;
315            }
316    
317            /**
318             * Sets the Spring bean ID for this bean.
319             *
320             * @param beanIdentifier the Spring bean ID for this bean
321             */
322            @Override
323            public void setBeanIdentifier(String beanIdentifier) {
324                    _beanIdentifier = beanIdentifier;
325            }
326    
327            protected Class<?> getModelClass() {
328                    return MDRAction.class;
329            }
330    
331            protected String getModelClassName() {
332                    return MDRAction.class.getName();
333            }
334    
335            /**
336             * Performs a SQL query.
337             *
338             * @param sql the sql query
339             */
340            protected void runSQL(String sql) {
341                    try {
342                            DataSource dataSource = mdrActionPersistence.getDataSource();
343    
344                            DB db = DBFactoryUtil.getDB();
345    
346                            sql = db.buildSQL(sql);
347                            sql = PortalUtil.transformSQL(sql);
348    
349                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
350                                            sql, new int[0]);
351    
352                            sqlUpdate.update();
353                    }
354                    catch (Exception e) {
355                            throw new SystemException(e);
356                    }
357            }
358    
359            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService.class)
360            protected com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService;
361            @BeanReference(type = MDRActionService.class)
362            protected MDRActionService mdrActionService;
363            @BeanReference(type = MDRActionPersistence.class)
364            protected MDRActionPersistence mdrActionPersistence;
365            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
366            protected com.liferay.counter.service.CounterLocalService counterLocalService;
367            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
368            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
369            @BeanReference(type = SystemEventPersistence.class)
370            protected SystemEventPersistence systemEventPersistence;
371            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
372            protected com.liferay.portal.service.UserLocalService userLocalService;
373            @BeanReference(type = com.liferay.portal.service.UserService.class)
374            protected com.liferay.portal.service.UserService userService;
375            @BeanReference(type = UserPersistence.class)
376            protected UserPersistence userPersistence;
377            @BeanReference(type = UserFinder.class)
378            protected UserFinder userFinder;
379            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService.class)
380            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
381            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService.class)
382            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
383            @BeanReference(type = MDRRuleGroupInstancePersistence.class)
384            protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
385            private String _beanIdentifier;
386    }