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.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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, IdentifiableOSGiService {
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 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(PortalLocalService portalLocalService) {
070                    this.portalLocalService = portalLocalService;
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            /**
093             * Returns the class name local service.
094             *
095             * @return the class name local service
096             */
097            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
098                    return classNameLocalService;
099            }
100    
101            /**
102             * Sets the class name local service.
103             *
104             * @param classNameLocalService the class name local service
105             */
106            public void setClassNameLocalService(
107                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
108                    this.classNameLocalService = classNameLocalService;
109            }
110    
111            /**
112             * Returns the class name persistence.
113             *
114             * @return the class name persistence
115             */
116            public ClassNamePersistence getClassNamePersistence() {
117                    return classNamePersistence;
118            }
119    
120            /**
121             * Sets the class name persistence.
122             *
123             * @param classNamePersistence the class name persistence
124             */
125            public void setClassNamePersistence(
126                    ClassNamePersistence classNamePersistence) {
127                    this.classNamePersistence = classNamePersistence;
128            }
129    
130            public void afterPropertiesSet() {
131            }
132    
133            public void destroy() {
134            }
135    
136            /**
137             * Returns the OSGi service identifier.
138             *
139             * @return the OSGi service identifier
140             */
141            @Override
142            public String getOSGiServiceIdentifier() {
143                    return PortalLocalService.class.getName();
144            }
145    
146            /**
147             * Performs a SQL query.
148             *
149             * @param sql the sql query
150             */
151            protected void runSQL(String sql) {
152                    try {
153                            DataSource dataSource = InfrastructureUtil.getDataSource();
154    
155                            DB db = DBManagerUtil.getDB();
156    
157                            sql = db.buildSQL(sql);
158                            sql = PortalUtil.transformSQL(sql);
159    
160                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
161                                            sql, new int[0]);
162    
163                            sqlUpdate.update();
164                    }
165                    catch (Exception e) {
166                            throw new SystemException(e);
167                    }
168            }
169    
170            @BeanReference(type = com.liferay.portal.service.PortalLocalService.class)
171            protected PortalLocalService portalLocalService;
172            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
173            protected com.liferay.counter.service.CounterLocalService counterLocalService;
174            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
175            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
176            @BeanReference(type = ClassNamePersistence.class)
177            protected ClassNamePersistence classNamePersistence;
178    }