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 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(MDRRuleService mdrRuleService) {
092                    this.mdrRuleService = mdrRuleService;
093            }
094    
095            /**
096             * Returns the m d r rule persistence.
097             *
098             * @return the m d r rule persistence
099             */
100            public MDRRulePersistence getMDRRulePersistence() {
101                    return mdrRulePersistence;
102            }
103    
104            /**
105             * Sets the m d r rule persistence.
106             *
107             * @param mdrRulePersistence the m d r rule persistence
108             */
109            public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
110                    this.mdrRulePersistence = mdrRulePersistence;
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 local service.
246             *
247             * @return the m d r rule group local service
248             */
249            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
250                    return mdrRuleGroupLocalService;
251            }
252    
253            /**
254             * Sets the m d r rule group local service.
255             *
256             * @param mdrRuleGroupLocalService the m d r rule group local service
257             */
258            public void setMDRRuleGroupLocalService(
259                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService) {
260                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
261            }
262    
263            /**
264             * Returns the m d r rule group remote service.
265             *
266             * @return the m d r rule group remote service
267             */
268            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService getMDRRuleGroupService() {
269                    return mdrRuleGroupService;
270            }
271    
272            /**
273             * Sets the m d r rule group remote service.
274             *
275             * @param mdrRuleGroupService the m d r rule group remote service
276             */
277            public void setMDRRuleGroupService(
278                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService) {
279                    this.mdrRuleGroupService = mdrRuleGroupService;
280            }
281    
282            /**
283             * Returns the m d r rule group persistence.
284             *
285             * @return the m d r rule group persistence
286             */
287            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
288                    return mdrRuleGroupPersistence;
289            }
290    
291            /**
292             * Sets the m d r rule group persistence.
293             *
294             * @param mdrRuleGroupPersistence the m d r rule group persistence
295             */
296            public void setMDRRuleGroupPersistence(
297                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
298                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
299            }
300    
301            /**
302             * Returns the m d r rule group finder.
303             *
304             * @return the m d r rule group finder
305             */
306            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
307                    return mdrRuleGroupFinder;
308            }
309    
310            /**
311             * Sets the m d r rule group finder.
312             *
313             * @param mdrRuleGroupFinder the m d r rule group finder
314             */
315            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
316                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
317            }
318    
319            public void afterPropertiesSet() {
320            }
321    
322            public void destroy() {
323            }
324    
325            /**
326             * Returns the Spring bean ID for this bean.
327             *
328             * @return the Spring bean ID for this bean
329             */
330            @Override
331            public String getBeanIdentifier() {
332                    return _beanIdentifier;
333            }
334    
335            /**
336             * Sets the Spring bean ID for this bean.
337             *
338             * @param beanIdentifier the Spring bean ID for this bean
339             */
340            @Override
341            public void setBeanIdentifier(String beanIdentifier) {
342                    _beanIdentifier = beanIdentifier;
343            }
344    
345            protected Class<?> getModelClass() {
346                    return MDRRule.class;
347            }
348    
349            protected String getModelClassName() {
350                    return MDRRule.class.getName();
351            }
352    
353            /**
354             * Performs a SQL query.
355             *
356             * @param sql the sql query
357             */
358            protected void runSQL(String sql) {
359                    try {
360                            DataSource dataSource = mdrRulePersistence.getDataSource();
361    
362                            DB db = DBFactoryUtil.getDB();
363    
364                            sql = db.buildSQL(sql);
365                            sql = PortalUtil.transformSQL(sql);
366    
367                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
368                                            sql, new int[0]);
369    
370                            sqlUpdate.update();
371                    }
372                    catch (Exception e) {
373                            throw new SystemException(e);
374                    }
375            }
376    
377            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService.class)
378            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService mdrRuleLocalService;
379            @BeanReference(type = MDRRuleService.class)
380            protected MDRRuleService mdrRuleService;
381            @BeanReference(type = MDRRulePersistence.class)
382            protected MDRRulePersistence mdrRulePersistence;
383            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
384            protected com.liferay.counter.service.CounterLocalService counterLocalService;
385            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
386            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
387            @BeanReference(type = SystemEventPersistence.class)
388            protected SystemEventPersistence systemEventPersistence;
389            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
390            protected com.liferay.portal.service.UserLocalService userLocalService;
391            @BeanReference(type = com.liferay.portal.service.UserService.class)
392            protected com.liferay.portal.service.UserService userService;
393            @BeanReference(type = UserPersistence.class)
394            protected UserPersistence userPersistence;
395            @BeanReference(type = UserFinder.class)
396            protected UserFinder userFinder;
397            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService.class)
398            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService;
399            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService.class)
400            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService;
401            @BeanReference(type = MDRRuleGroupPersistence.class)
402            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
403            @BeanReference(type = MDRRuleGroupFinder.class)
404            protected MDRRuleGroupFinder mdrRuleGroupFinder;
405            private String _beanIdentifier;
406    }