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.PortalLocalService;
029    import com.liferay.portal.service.persistence.ClassNamePersistence;
030    import com.liferay.portal.util.PortalUtil;
031    
032    import javax.sql.DataSource;
033    
034    /**
035     * Provides the base implementation for the portal local service.
036     *
037     * <p>
038     * 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.PortalLocalServiceImpl}.
039     * </p>
040     *
041     * @author Brian Wing Shun Chan
042     * @see com.liferay.portal.service.impl.PortalLocalServiceImpl
043     * @see com.liferay.portal.service.PortalLocalServiceUtil
044     * @generated
045     */
046    @ProviderType
047    public abstract class PortalLocalServiceBaseImpl extends BaseLocalServiceImpl
048            implements PortalLocalService, IdentifiableBean {
049            /*
050             * NOTE FOR DEVELOPERS:
051             *
052             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.PortalLocalServiceUtil} to access the portal local service.
053             */
054    
055            /**
056             * Returns the portal local service.
057             *
058             * @return the portal local service
059             */
060            public com.liferay.portal.service.PortalLocalService getPortalLocalService() {
061                    return portalLocalService;
062            }
063    
064            /**
065             * Sets the portal local service.
066             *
067             * @param portalLocalService the portal local service
068             */
069            public void setPortalLocalService(
070                    com.liferay.portal.service.PortalLocalService portalLocalService) {
071                    this.portalLocalService = portalLocalService;
072            }
073    
074            /**
075             * Returns the portal remote service.
076             *
077             * @return the portal remote service
078             */
079            public com.liferay.portal.service.PortalService getPortalService() {
080                    return portalService;
081            }
082    
083            /**
084             * Sets the portal remote service.
085             *
086             * @param portalService the portal remote service
087             */
088            public void setPortalService(
089                    com.liferay.portal.service.PortalService portalService) {
090                    this.portalService = portalService;
091            }
092    
093            /**
094             * Returns the counter local service.
095             *
096             * @return the counter local service
097             */
098            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
099                    return counterLocalService;
100            }
101    
102            /**
103             * Sets the counter local service.
104             *
105             * @param counterLocalService the counter local service
106             */
107            public void setCounterLocalService(
108                    com.liferay.counter.service.CounterLocalService counterLocalService) {
109                    this.counterLocalService = counterLocalService;
110            }
111    
112            /**
113             * Returns the class name local service.
114             *
115             * @return the class name local service
116             */
117            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
118                    return classNameLocalService;
119            }
120    
121            /**
122             * Sets the class name local service.
123             *
124             * @param classNameLocalService the class name local service
125             */
126            public void setClassNameLocalService(
127                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
128                    this.classNameLocalService = classNameLocalService;
129            }
130    
131            /**
132             * Returns the class name remote service.
133             *
134             * @return the class name remote service
135             */
136            public com.liferay.portal.service.ClassNameService getClassNameService() {
137                    return classNameService;
138            }
139    
140            /**
141             * Sets the class name remote service.
142             *
143             * @param classNameService the class name remote service
144             */
145            public void setClassNameService(
146                    com.liferay.portal.service.ClassNameService classNameService) {
147                    this.classNameService = classNameService;
148            }
149    
150            /**
151             * Returns the class name persistence.
152             *
153             * @return the class name persistence
154             */
155            public ClassNamePersistence getClassNamePersistence() {
156                    return classNamePersistence;
157            }
158    
159            /**
160             * Sets the class name persistence.
161             *
162             * @param classNamePersistence the class name persistence
163             */
164            public void setClassNamePersistence(
165                    ClassNamePersistence classNamePersistence) {
166                    this.classNamePersistence = classNamePersistence;
167            }
168    
169            public void afterPropertiesSet() {
170            }
171    
172            public void destroy() {
173            }
174    
175            /**
176             * Returns the Spring bean ID for this bean.
177             *
178             * @return the Spring bean ID for this bean
179             */
180            @Override
181            public String getBeanIdentifier() {
182                    return _beanIdentifier;
183            }
184    
185            /**
186             * Sets the Spring bean ID for this bean.
187             *
188             * @param beanIdentifier the Spring bean ID for this bean
189             */
190            @Override
191            public void setBeanIdentifier(String beanIdentifier) {
192                    _beanIdentifier = beanIdentifier;
193            }
194    
195            /**
196             * Performs a SQL query.
197             *
198             * @param sql the sql query
199             */
200            protected void runSQL(String sql) {
201                    try {
202                            DataSource dataSource = InfrastructureUtil.getDataSource();
203    
204                            DB db = DBFactoryUtil.getDB();
205    
206                            sql = db.buildSQL(sql);
207                            sql = PortalUtil.transformSQL(sql);
208    
209                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
210                                            sql, new int[0]);
211    
212                            sqlUpdate.update();
213                    }
214                    catch (Exception e) {
215                            throw new SystemException(e);
216                    }
217            }
218    
219            @BeanReference(type = com.liferay.portal.service.PortalLocalService.class)
220            protected com.liferay.portal.service.PortalLocalService portalLocalService;
221            @BeanReference(type = com.liferay.portal.service.PortalService.class)
222            protected com.liferay.portal.service.PortalService portalService;
223            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
224            protected com.liferay.counter.service.CounterLocalService counterLocalService;
225            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
226            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
227            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
228            protected com.liferay.portal.service.ClassNameService classNameService;
229            @BeanReference(type = ClassNamePersistence.class)
230            protected ClassNamePersistence classNamePersistence;
231            private String _beanIdentifier;
232    }