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.MDRRule;
031    import com.liferay.portlet.mobiledevicerules.service.MDRRuleService;
032    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
033    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
034    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRulePersistence;
035    
036    import javax.sql.DataSource;
037    
038    /**
039     * Provides the base implementation for the m d r rule remote service.
040     *
041     * <p>
042     * 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.MDRRuleServiceImpl}.
043     * </p>
044     *
045     * @author Edward C. Han
046     * @see com.liferay.portlet.mobiledevicerules.service.impl.MDRRuleServiceImpl
047     * @see com.liferay.portlet.mobiledevicerules.service.MDRRuleServiceUtil
048     * @generated
049     */
050    public abstract class MDRRuleServiceBaseImpl extends BaseServiceImpl
051            implements MDRRuleService, IdentifiableBean {
052            /*
053             * NOTE FOR DEVELOPERS:
054             *
055             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleServiceUtil} to access the m d r rule remote service.
056             */
057    
058            /**
059             * Returns the m d r rule local service.
060             *
061             * @return the m d r rule local service
062             */
063            public com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService getMDRRuleLocalService() {
064                    return mdrRuleLocalService;
065            }
066    
067            /**
068             * Sets the m d r rule local service.
069             *
070             * @param mdrRuleLocalService the m d r rule local service
071             */
072            public void setMDRRuleLocalService(
073                    com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService mdrRuleLocalService) {
074                    this.mdrRuleLocalService = mdrRuleLocalService;
075            }
076    
077            /**
078             * Returns the m d r rule remote service.
079             *
080             * @return the m d r rule remote service
081             */
082            public com.liferay.portlet.mobiledevicerules.service.MDRRuleService getMDRRuleService() {
083                    return mdrRuleService;
084            }
085    
086            /**
087             * Sets the m d r rule remote service.
088             *
089             * @param mdrRuleService the m d r rule remote service
090             */
091            public void setMDRRuleService(
092                    com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService) {
093                    this.mdrRuleService = mdrRuleService;
094            }
095    
096            /**
097             * Returns the m d r rule persistence.
098             *
099             * @return the m d r rule persistence
100             */
101            public MDRRulePersistence getMDRRulePersistence() {
102                    return mdrRulePersistence;
103            }
104    
105            /**
106             * Sets the m d r rule persistence.
107             *
108             * @param mdrRulePersistence the m d r rule persistence
109             */
110            public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
111                    this.mdrRulePersistence = mdrRulePersistence;
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 local service.
247             *
248             * @return the m d r rule group local service
249             */
250            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
251                    return mdrRuleGroupLocalService;
252            }
253    
254            /**
255             * Sets the m d r rule group local service.
256             *
257             * @param mdrRuleGroupLocalService the m d r rule group local service
258             */
259            public void setMDRRuleGroupLocalService(
260                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService) {
261                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
262            }
263    
264            /**
265             * Returns the m d r rule group remote service.
266             *
267             * @return the m d r rule group remote service
268             */
269            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService getMDRRuleGroupService() {
270                    return mdrRuleGroupService;
271            }
272    
273            /**
274             * Sets the m d r rule group remote service.
275             *
276             * @param mdrRuleGroupService the m d r rule group remote service
277             */
278            public void setMDRRuleGroupService(
279                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService) {
280                    this.mdrRuleGroupService = mdrRuleGroupService;
281            }
282    
283            /**
284             * Returns the m d r rule group persistence.
285             *
286             * @return the m d r rule group persistence
287             */
288            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
289                    return mdrRuleGroupPersistence;
290            }
291    
292            /**
293             * Sets the m d r rule group persistence.
294             *
295             * @param mdrRuleGroupPersistence the m d r rule group persistence
296             */
297            public void setMDRRuleGroupPersistence(
298                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
299                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
300            }
301    
302            /**
303             * Returns the m d r rule group finder.
304             *
305             * @return the m d r rule group finder
306             */
307            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
308                    return mdrRuleGroupFinder;
309            }
310    
311            /**
312             * Sets the m d r rule group finder.
313             *
314             * @param mdrRuleGroupFinder the m d r rule group finder
315             */
316            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
317                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
318            }
319    
320            public void afterPropertiesSet() {
321            }
322    
323            public void destroy() {
324            }
325    
326            /**
327             * Returns the Spring bean ID for this bean.
328             *
329             * @return the Spring bean ID for this bean
330             */
331            @Override
332            public String getBeanIdentifier() {
333                    return _beanIdentifier;
334            }
335    
336            /**
337             * Sets the Spring bean ID for this bean.
338             *
339             * @param beanIdentifier the Spring bean ID for this bean
340             */
341            @Override
342            public void setBeanIdentifier(String beanIdentifier) {
343                    _beanIdentifier = beanIdentifier;
344            }
345    
346            protected Class<?> getModelClass() {
347                    return MDRRule.class;
348            }
349    
350            protected String getModelClassName() {
351                    return MDRRule.class.getName();
352            }
353    
354            /**
355             * Performs a SQL query.
356             *
357             * @param sql the sql query
358             */
359            protected void runSQL(String sql) {
360                    try {
361                            DataSource dataSource = mdrRulePersistence.getDataSource();
362    
363                            DB db = DBFactoryUtil.getDB();
364    
365                            sql = db.buildSQL(sql);
366                            sql = PortalUtil.transformSQL(sql);
367    
368                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
369                                            sql, new int[0]);
370    
371                            sqlUpdate.update();
372                    }
373                    catch (Exception e) {
374                            throw new SystemException(e);
375                    }
376            }
377    
378            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService.class)
379            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService mdrRuleLocalService;
380            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleService.class)
381            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService;
382            @BeanReference(type = MDRRulePersistence.class)
383            protected MDRRulePersistence mdrRulePersistence;
384            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
385            protected com.liferay.counter.service.CounterLocalService counterLocalService;
386            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
387            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
388            @BeanReference(type = SystemEventPersistence.class)
389            protected SystemEventPersistence systemEventPersistence;
390            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
391            protected com.liferay.portal.service.UserLocalService userLocalService;
392            @BeanReference(type = com.liferay.portal.service.UserService.class)
393            protected com.liferay.portal.service.UserService userService;
394            @BeanReference(type = UserPersistence.class)
395            protected UserPersistence userPersistence;
396            @BeanReference(type = UserFinder.class)
397            protected UserFinder userFinder;
398            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService.class)
399            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService;
400            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService.class)
401            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService;
402            @BeanReference(type = MDRRuleGroupPersistence.class)
403            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
404            @BeanReference(type = MDRRuleGroupFinder.class)
405            protected MDRRuleGroupFinder mdrRuleGroupFinder;
406            private String _beanIdentifier;
407    }