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.model.ListType;
025    import com.liferay.portal.service.BaseServiceImpl;
026    import com.liferay.portal.service.ListTypeService;
027    import com.liferay.portal.service.persistence.ClassNamePersistence;
028    import com.liferay.portal.service.persistence.ListTypePersistence;
029    import com.liferay.portal.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.service.ListTypeServiceUtil
043     * @generated
044     */
045    public abstract class ListTypeServiceBaseImpl extends BaseServiceImpl
046            implements ListTypeService, IdentifiableBean {
047            /*
048             * NOTE FOR DEVELOPERS:
049             *
050             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.ListTypeServiceUtil} to access the list type remote service.
051             */
052    
053            /**
054             * Returns the list type remote service.
055             *
056             * @return the list type remote service
057             */
058            public com.liferay.portal.service.ListTypeService getListTypeService() {
059                    return listTypeService;
060            }
061    
062            /**
063             * Sets the list type remote service.
064             *
065             * @param listTypeService the list type remote service
066             */
067            public void setListTypeService(
068                    com.liferay.portal.service.ListTypeService listTypeService) {
069                    this.listTypeService = listTypeService;
070            }
071    
072            /**
073             * Returns the list type persistence.
074             *
075             * @return the list type persistence
076             */
077            public ListTypePersistence getListTypePersistence() {
078                    return listTypePersistence;
079            }
080    
081            /**
082             * Sets the list type persistence.
083             *
084             * @param listTypePersistence the list type persistence
085             */
086            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
087                    this.listTypePersistence = listTypePersistence;
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            protected Class<?> getModelClass() {
193                    return ListType.class;
194            }
195    
196            protected String getModelClassName() {
197                    return ListType.class.getName();
198            }
199    
200            /**
201             * Performs a SQL query.
202             *
203             * @param sql the sql query
204             */
205            protected void runSQL(String sql) {
206                    try {
207                            DataSource dataSource = listTypePersistence.getDataSource();
208    
209                            DB db = DBFactoryUtil.getDB();
210    
211                            sql = db.buildSQL(sql);
212                            sql = PortalUtil.transformSQL(sql);
213    
214                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
215                                            sql, new int[0]);
216    
217                            sqlUpdate.update();
218                    }
219                    catch (Exception e) {
220                            throw new SystemException(e);
221                    }
222            }
223    
224            @BeanReference(type = com.liferay.portal.service.ListTypeService.class)
225            protected com.liferay.portal.service.ListTypeService listTypeService;
226            @BeanReference(type = ListTypePersistence.class)
227            protected ListTypePersistence listTypePersistence;
228            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
229            protected com.liferay.counter.service.CounterLocalService counterLocalService;
230            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
231            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
232            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
233            protected com.liferay.portal.service.ClassNameService classNameService;
234            @BeanReference(type = ClassNamePersistence.class)
235            protected ClassNamePersistence classNamePersistence;
236            private String _beanIdentifier;
237    }