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.portal.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.util.InfrastructureUtil;
027    import com.liferay.portal.service.BaseLocalServiceImpl;
028    import com.liferay.portal.service.QuartzLocalService;
029    import com.liferay.portal.util.PortalUtil;
030    
031    import javax.sql.DataSource;
032    
033    /**
034     * Provides the base implementation for the quartz local service.
035     *
036     * <p>
037     * 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.portal.service.impl.QuartzLocalServiceImpl}.
038     * </p>
039     *
040     * @author Brian Wing Shun Chan
041     * @see com.liferay.portal.service.impl.QuartzLocalServiceImpl
042     * @see com.liferay.portal.service.QuartzLocalServiceUtil
043     * @generated
044     */
045    @ProviderType
046    public abstract class QuartzLocalServiceBaseImpl extends BaseLocalServiceImpl
047            implements QuartzLocalService, IdentifiableBean {
048            /*
049             * NOTE FOR DEVELOPERS:
050             *
051             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.QuartzLocalServiceUtil} to access the quartz local service.
052             */
053    
054            /**
055             * Returns the quartz local service.
056             *
057             * @return the quartz local service
058             */
059            public com.liferay.portal.service.QuartzLocalService getQuartzLocalService() {
060                    return quartzLocalService;
061            }
062    
063            /**
064             * Sets the quartz local service.
065             *
066             * @param quartzLocalService the quartz local service
067             */
068            public void setQuartzLocalService(
069                    com.liferay.portal.service.QuartzLocalService quartzLocalService) {
070                    this.quartzLocalService = quartzLocalService;
071            }
072    
073            /**
074             * Returns the counter local service.
075             *
076             * @return the counter local service
077             */
078            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
079                    return counterLocalService;
080            }
081    
082            /**
083             * Sets the counter local service.
084             *
085             * @param counterLocalService the counter local service
086             */
087            public void setCounterLocalService(
088                    com.liferay.counter.service.CounterLocalService counterLocalService) {
089                    this.counterLocalService = counterLocalService;
090            }
091    
092            public void afterPropertiesSet() {
093            }
094    
095            public void destroy() {
096            }
097    
098            /**
099             * Returns the Spring bean ID for this bean.
100             *
101             * @return the Spring bean ID for this bean
102             */
103            @Override
104            public String getBeanIdentifier() {
105                    return _beanIdentifier;
106            }
107    
108            /**
109             * Sets the Spring bean ID for this bean.
110             *
111             * @param beanIdentifier the Spring bean ID for this bean
112             */
113            @Override
114            public void setBeanIdentifier(String beanIdentifier) {
115                    _beanIdentifier = beanIdentifier;
116            }
117    
118            /**
119             * Performs a SQL query.
120             *
121             * @param sql the sql query
122             */
123            protected void runSQL(String sql) {
124                    try {
125                            DataSource dataSource = InfrastructureUtil.getDataSource();
126    
127                            DB db = DBFactoryUtil.getDB();
128    
129                            sql = db.buildSQL(sql);
130                            sql = PortalUtil.transformSQL(sql);
131    
132                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
133                                            sql, new int[0]);
134    
135                            sqlUpdate.update();
136                    }
137                    catch (Exception e) {
138                            throw new SystemException(e);
139                    }
140            }
141    
142            @BeanReference(type = com.liferay.portal.service.QuartzLocalService.class)
143            protected com.liferay.portal.service.QuartzLocalService quartzLocalService;
144            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
145            protected com.liferay.counter.service.CounterLocalService counterLocalService;
146            private String _beanIdentifier;
147    }