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.dao.db.DB;
019    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.model.ListType;
024    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
025    import com.liferay.portal.kernel.service.BaseServiceImpl;
026    import com.liferay.portal.kernel.service.ListTypeService;
027    import com.liferay.portal.kernel.service.persistence.ClassNamePersistence;
028    import com.liferay.portal.kernel.service.persistence.ListTypePersistence;
029    import com.liferay.portal.kernel.util.PortalUtil;
030    
031    import javax.sql.DataSource;
032    
033    /**
034     * Provides the base implementation for the list type remote 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.ListTypeServiceImpl}.
038     * </p>
039     *
040     * @author Brian Wing Shun Chan
041     * @see com.liferay.portal.service.impl.ListTypeServiceImpl
042     * @see com.liferay.portal.kernel.service.ListTypeServiceUtil
043     * @generated
044     */
045    public abstract class ListTypeServiceBaseImpl extends BaseServiceImpl
046            implements ListTypeService, IdentifiableOSGiService {
047            /*
048             * NOTE FOR DEVELOPERS:
049             *
050             * Never modify or reference this class directly. Always use {@link com.liferay.portal.kernel.service.ListTypeServiceUtil} to access the list type remote service.
051             */
052    
053            /**
054             * Returns the list type local service.
055             *
056             * @return the list type local service
057             */
058            public com.liferay.portal.kernel.service.ListTypeLocalService getListTypeLocalService() {
059                    return listTypeLocalService;
060            }
061    
062            /**
063             * Sets the list type local service.
064             *
065             * @param listTypeLocalService the list type local service
066             */
067            public void setListTypeLocalService(
068                    com.liferay.portal.kernel.service.ListTypeLocalService listTypeLocalService) {
069                    this.listTypeLocalService = listTypeLocalService;
070            }
071    
072            /**
073             * Returns the list type remote service.
074             *
075             * @return the list type remote service
076             */
077            public ListTypeService getListTypeService() {
078                    return listTypeService;
079            }
080    
081            /**
082             * Sets the list type remote service.
083             *
084             * @param listTypeService the list type remote service
085             */
086            public void setListTypeService(ListTypeService listTypeService) {
087                    this.listTypeService = listTypeService;
088            }
089    
090            /**
091             * Returns the list type persistence.
092             *
093             * @return the list type persistence
094             */
095            public ListTypePersistence getListTypePersistence() {
096                    return listTypePersistence;
097            }
098    
099            /**
100             * Sets the list type persistence.
101             *
102             * @param listTypePersistence the list type persistence
103             */
104            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
105                    this.listTypePersistence = listTypePersistence;
106            }
107    
108            /**
109             * Returns the counter local service.
110             *
111             * @return the counter local service
112             */
113            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
114                    return counterLocalService;
115            }
116    
117            /**
118             * Sets the counter local service.
119             *
120             * @param counterLocalService the counter local service
121             */
122            public void setCounterLocalService(
123                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
124                    this.counterLocalService = counterLocalService;
125            }
126    
127            /**
128             * Returns the class name local service.
129             *
130             * @return the class name local service
131             */
132            public com.liferay.portal.kernel.service.ClassNameLocalService getClassNameLocalService() {
133                    return classNameLocalService;
134            }
135    
136            /**
137             * Sets the class name local service.
138             *
139             * @param classNameLocalService the class name local service
140             */
141            public void setClassNameLocalService(
142                    com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) {
143                    this.classNameLocalService = classNameLocalService;
144            }
145    
146            /**
147             * Returns the class name remote service.
148             *
149             * @return the class name remote service
150             */
151            public com.liferay.portal.kernel.service.ClassNameService getClassNameService() {
152                    return classNameService;
153            }
154    
155            /**
156             * Sets the class name remote service.
157             *
158             * @param classNameService the class name remote service
159             */
160            public void setClassNameService(
161                    com.liferay.portal.kernel.service.ClassNameService classNameService) {
162                    this.classNameService = classNameService;
163            }
164    
165            /**
166             * Returns the class name persistence.
167             *
168             * @return the class name persistence
169             */
170            public ClassNamePersistence getClassNamePersistence() {
171                    return classNamePersistence;
172            }
173    
174            /**
175             * Sets the class name persistence.
176             *
177             * @param classNamePersistence the class name persistence
178             */
179            public void setClassNamePersistence(
180                    ClassNamePersistence classNamePersistence) {
181                    this.classNamePersistence = classNamePersistence;
182            }
183    
184            public void afterPropertiesSet() {
185            }
186    
187            public void destroy() {
188            }
189    
190            /**
191             * Returns the OSGi service identifier.
192             *
193             * @return the OSGi service identifier
194             */
195            @Override
196            public String getOSGiServiceIdentifier() {
197                    return ListTypeService.class.getName();
198            }
199    
200            protected Class<?> getModelClass() {
201                    return ListType.class;
202            }
203    
204            protected String getModelClassName() {
205                    return ListType.class.getName();
206            }
207    
208            /**
209             * Performs a SQL query.
210             *
211             * @param sql the sql query
212             */
213            protected void runSQL(String sql) {
214                    try {
215                            DataSource dataSource = listTypePersistence.getDataSource();
216    
217                            DB db = DBManagerUtil.getDB();
218    
219                            sql = db.buildSQL(sql);
220                            sql = PortalUtil.transformSQL(sql);
221    
222                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
223                                            sql);
224    
225                            sqlUpdate.update();
226                    }
227                    catch (Exception e) {
228                            throw new SystemException(e);
229                    }
230            }
231    
232            @BeanReference(type = com.liferay.portal.kernel.service.ListTypeLocalService.class)
233            protected com.liferay.portal.kernel.service.ListTypeLocalService listTypeLocalService;
234            @BeanReference(type = ListTypeService.class)
235            protected ListTypeService listTypeService;
236            @BeanReference(type = ListTypePersistence.class)
237            protected ListTypePersistence listTypePersistence;
238            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
239            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
240            @BeanReference(type = com.liferay.portal.kernel.service.ClassNameLocalService.class)
241            protected com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService;
242            @BeanReference(type = com.liferay.portal.kernel.service.ClassNameService.class)
243            protected com.liferay.portal.kernel.service.ClassNameService classNameService;
244            @BeanReference(type = ClassNamePersistence.class)
245            protected ClassNamePersistence classNamePersistence;
246    }