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