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