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.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.module.framework.service.IdentifiableOSGiService;
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, IdentifiableOSGiService {
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 OSGi service identifier.
137             *
138             * @return the OSGi service identifier
139             */
140            @Override
141            public String getOSGiServiceIdentifier() {
142                    return AnnouncementsFlagService.class.getName();
143            }
144    
145            protected Class<?> getModelClass() {
146                    return AnnouncementsFlag.class;
147            }
148    
149            protected String getModelClassName() {
150                    return AnnouncementsFlag.class.getName();
151            }
152    
153            /**
154             * Performs a SQL query.
155             *
156             * @param sql the sql query
157             */
158            protected void runSQL(String sql) {
159                    try {
160                            DataSource dataSource = announcementsFlagPersistence.getDataSource();
161    
162                            DB db = DBManagerUtil.getDB();
163    
164                            sql = db.buildSQL(sql);
165                            sql = PortalUtil.transformSQL(sql);
166    
167                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
168                                            sql, new int[0]);
169    
170                            sqlUpdate.update();
171                    }
172                    catch (Exception e) {
173                            throw new SystemException(e);
174                    }
175            }
176    
177            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService.class)
178            protected com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService announcementsFlagLocalService;
179            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagService.class)
180            protected AnnouncementsFlagService announcementsFlagService;
181            @BeanReference(type = AnnouncementsFlagPersistence.class)
182            protected AnnouncementsFlagPersistence announcementsFlagPersistence;
183            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
184            protected com.liferay.counter.service.CounterLocalService counterLocalService;
185    }