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.portlet.announcements.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.service.BaseServiceImpl;
025    import com.liferay.portal.util.PortalUtil;
026    
027    import com.liferay.portlet.announcements.model.AnnouncementsFlag;
028    import com.liferay.portlet.announcements.service.AnnouncementsFlagService;
029    import com.liferay.portlet.announcements.service.persistence.AnnouncementsFlagPersistence;
030    
031    import javax.sql.DataSource;
032    
033    /**
034     * Provides the base implementation for the announcements flag 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.portlet.announcements.service.impl.AnnouncementsFlagServiceImpl}.
038     * </p>
039     *
040     * @author Brian Wing Shun Chan
041     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsFlagServiceImpl
042     * @see com.liferay.portlet.announcements.service.AnnouncementsFlagServiceUtil
043     * @generated
044     */
045    public abstract class AnnouncementsFlagServiceBaseImpl extends BaseServiceImpl
046            implements AnnouncementsFlagService, IdentifiableBean {
047            /*
048             * NOTE FOR DEVELOPERS:
049             *
050             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.announcements.service.AnnouncementsFlagServiceUtil} to access the announcements flag remote service.
051             */
052    
053            /**
054             * Returns the announcements flag local service.
055             *
056             * @return the announcements flag local service
057             */
058            public com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService getAnnouncementsFlagLocalService() {
059                    return announcementsFlagLocalService;
060            }
061    
062            /**
063             * Sets the announcements flag local service.
064             *
065             * @param announcementsFlagLocalService the announcements flag local service
066             */
067            public void setAnnouncementsFlagLocalService(
068                    com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService announcementsFlagLocalService) {
069                    this.announcementsFlagLocalService = announcementsFlagLocalService;
070            }
071    
072            /**
073             * Returns the announcements flag remote service.
074             *
075             * @return the announcements flag remote service
076             */
077            public AnnouncementsFlagService getAnnouncementsFlagService() {
078                    return announcementsFlagService;
079            }
080    
081            /**
082             * Sets the announcements flag remote service.
083             *
084             * @param announcementsFlagService the announcements flag remote service
085             */
086            public void setAnnouncementsFlagService(
087                    AnnouncementsFlagService announcementsFlagService) {
088                    this.announcementsFlagService = announcementsFlagService;
089            }
090    
091            /**
092             * Returns the announcements flag persistence.
093             *
094             * @return the announcements flag persistence
095             */
096            public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
097                    return announcementsFlagPersistence;
098            }
099    
100            /**
101             * Sets the announcements flag persistence.
102             *
103             * @param announcementsFlagPersistence the announcements flag persistence
104             */
105            public void setAnnouncementsFlagPersistence(
106                    AnnouncementsFlagPersistence announcementsFlagPersistence) {
107                    this.announcementsFlagPersistence = announcementsFlagPersistence;
108            }
109    
110            /**
111             * Returns the counter local service.
112             *
113             * @return the counter local service
114             */
115            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
116                    return counterLocalService;
117            }
118    
119            /**
120             * Sets the counter local service.
121             *
122             * @param counterLocalService the counter local service
123             */
124            public void setCounterLocalService(
125                    com.liferay.counter.service.CounterLocalService counterLocalService) {
126                    this.counterLocalService = counterLocalService;
127            }
128    
129            public void afterPropertiesSet() {
130            }
131    
132            public void destroy() {
133            }
134    
135            /**
136             * Returns the Spring bean ID for this bean.
137             *
138             * @return the Spring bean ID for this bean
139             */
140            @Override
141            public String getBeanIdentifier() {
142                    return _beanIdentifier;
143            }
144    
145            /**
146             * Sets the Spring bean ID for this bean.
147             *
148             * @param beanIdentifier the Spring bean ID for this bean
149             */
150            @Override
151            public void setBeanIdentifier(String beanIdentifier) {
152                    _beanIdentifier = beanIdentifier;
153            }
154    
155            protected Class<?> getModelClass() {
156                    return AnnouncementsFlag.class;
157            }
158    
159            protected String getModelClassName() {
160                    return AnnouncementsFlag.class.getName();
161            }
162    
163            /**
164             * Performs a SQL query.
165             *
166             * @param sql the sql query
167             */
168            protected void runSQL(String sql) {
169                    try {
170                            DataSource dataSource = announcementsFlagPersistence.getDataSource();
171    
172                            DB db = DBFactoryUtil.getDB();
173    
174                            sql = db.buildSQL(sql);
175                            sql = PortalUtil.transformSQL(sql);
176    
177                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
178                                            sql, new int[0]);
179    
180                            sqlUpdate.update();
181                    }
182                    catch (Exception e) {
183                            throw new SystemException(e);
184                    }
185            }
186    
187            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService.class)
188            protected com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService announcementsFlagLocalService;
189            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagService.class)
190            protected AnnouncementsFlagService announcementsFlagService;
191            @BeanReference(type = AnnouncementsFlagPersistence.class)
192            protected AnnouncementsFlagPersistence announcementsFlagPersistence;
193            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
194            protected com.liferay.counter.service.CounterLocalService counterLocalService;
195            private String _beanIdentifier;
196    }