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.service.persistence.UserFinder;
026    import com.liferay.portal.service.persistence.UserPersistence;
027    import com.liferay.portal.util.PortalUtil;
028    
029    import com.liferay.portlet.announcements.model.AnnouncementsDelivery;
030    import com.liferay.portlet.announcements.service.AnnouncementsDeliveryService;
031    import com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistence;
032    
033    import javax.sql.DataSource;
034    
035    /**
036     * Provides the base implementation for the announcements delivery remote service.
037     *
038     * <p>
039     * 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.AnnouncementsDeliveryServiceImpl}.
040     * </p>
041     *
042     * @author Brian Wing Shun Chan
043     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryServiceImpl
044     * @see com.liferay.portlet.announcements.service.AnnouncementsDeliveryServiceUtil
045     * @generated
046     */
047    public abstract class AnnouncementsDeliveryServiceBaseImpl
048            extends BaseServiceImpl implements AnnouncementsDeliveryService,
049                    IdentifiableOSGiService {
050            /*
051             * NOTE FOR DEVELOPERS:
052             *
053             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.announcements.service.AnnouncementsDeliveryServiceUtil} to access the announcements delivery remote service.
054             */
055    
056            /**
057             * Returns the announcements delivery local service.
058             *
059             * @return the announcements delivery local service
060             */
061            public com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService getAnnouncementsDeliveryLocalService() {
062                    return announcementsDeliveryLocalService;
063            }
064    
065            /**
066             * Sets the announcements delivery local service.
067             *
068             * @param announcementsDeliveryLocalService the announcements delivery local service
069             */
070            public void setAnnouncementsDeliveryLocalService(
071                    com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService) {
072                    this.announcementsDeliveryLocalService = announcementsDeliveryLocalService;
073            }
074    
075            /**
076             * Returns the announcements delivery remote service.
077             *
078             * @return the announcements delivery remote service
079             */
080            public AnnouncementsDeliveryService getAnnouncementsDeliveryService() {
081                    return announcementsDeliveryService;
082            }
083    
084            /**
085             * Sets the announcements delivery remote service.
086             *
087             * @param announcementsDeliveryService the announcements delivery remote service
088             */
089            public void setAnnouncementsDeliveryService(
090                    AnnouncementsDeliveryService announcementsDeliveryService) {
091                    this.announcementsDeliveryService = announcementsDeliveryService;
092            }
093    
094            /**
095             * Returns the announcements delivery persistence.
096             *
097             * @return the announcements delivery persistence
098             */
099            public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
100                    return announcementsDeliveryPersistence;
101            }
102    
103            /**
104             * Sets the announcements delivery persistence.
105             *
106             * @param announcementsDeliveryPersistence the announcements delivery persistence
107             */
108            public void setAnnouncementsDeliveryPersistence(
109                    AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
110                    this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
111            }
112    
113            /**
114             * Returns the counter local service.
115             *
116             * @return the counter local service
117             */
118            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
119                    return counterLocalService;
120            }
121    
122            /**
123             * Sets the counter local service.
124             *
125             * @param counterLocalService the counter local service
126             */
127            public void setCounterLocalService(
128                    com.liferay.counter.service.CounterLocalService counterLocalService) {
129                    this.counterLocalService = counterLocalService;
130            }
131    
132            /**
133             * Returns the user local service.
134             *
135             * @return the user local service
136             */
137            public com.liferay.portal.service.UserLocalService getUserLocalService() {
138                    return userLocalService;
139            }
140    
141            /**
142             * Sets the user local service.
143             *
144             * @param userLocalService the user local service
145             */
146            public void setUserLocalService(
147                    com.liferay.portal.service.UserLocalService userLocalService) {
148                    this.userLocalService = userLocalService;
149            }
150    
151            /**
152             * Returns the user remote service.
153             *
154             * @return the user remote service
155             */
156            public com.liferay.portal.service.UserService getUserService() {
157                    return userService;
158            }
159    
160            /**
161             * Sets the user remote service.
162             *
163             * @param userService the user remote service
164             */
165            public void setUserService(
166                    com.liferay.portal.service.UserService userService) {
167                    this.userService = userService;
168            }
169    
170            /**
171             * Returns the user persistence.
172             *
173             * @return the user persistence
174             */
175            public UserPersistence getUserPersistence() {
176                    return userPersistence;
177            }
178    
179            /**
180             * Sets the user persistence.
181             *
182             * @param userPersistence the user persistence
183             */
184            public void setUserPersistence(UserPersistence userPersistence) {
185                    this.userPersistence = userPersistence;
186            }
187    
188            /**
189             * Returns the user finder.
190             *
191             * @return the user finder
192             */
193            public UserFinder getUserFinder() {
194                    return userFinder;
195            }
196    
197            /**
198             * Sets the user finder.
199             *
200             * @param userFinder the user finder
201             */
202            public void setUserFinder(UserFinder userFinder) {
203                    this.userFinder = userFinder;
204            }
205    
206            public void afterPropertiesSet() {
207            }
208    
209            public void destroy() {
210            }
211    
212            /**
213             * Returns the OSGi service identifier.
214             *
215             * @return the OSGi service identifier
216             */
217            @Override
218            public String getOSGiServiceIdentifier() {
219                    return AnnouncementsDeliveryService.class.getName();
220            }
221    
222            protected Class<?> getModelClass() {
223                    return AnnouncementsDelivery.class;
224            }
225    
226            protected String getModelClassName() {
227                    return AnnouncementsDelivery.class.getName();
228            }
229    
230            /**
231             * Performs a SQL query.
232             *
233             * @param sql the sql query
234             */
235            protected void runSQL(String sql) {
236                    try {
237                            DataSource dataSource = announcementsDeliveryPersistence.getDataSource();
238    
239                            DB db = DBManagerUtil.getDB();
240    
241                            sql = db.buildSQL(sql);
242                            sql = PortalUtil.transformSQL(sql);
243    
244                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
245                                            sql, new int[0]);
246    
247                            sqlUpdate.update();
248                    }
249                    catch (Exception e) {
250                            throw new SystemException(e);
251                    }
252            }
253    
254            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService.class)
255            protected com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
256            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryService.class)
257            protected AnnouncementsDeliveryService announcementsDeliveryService;
258            @BeanReference(type = AnnouncementsDeliveryPersistence.class)
259            protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
260            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
261            protected com.liferay.counter.service.CounterLocalService counterLocalService;
262            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
263            protected com.liferay.portal.service.UserLocalService userLocalService;
264            @BeanReference(type = com.liferay.portal.service.UserService.class)
265            protected com.liferay.portal.service.UserService userService;
266            @BeanReference(type = UserPersistence.class)
267            protected UserPersistence userPersistence;
268            @BeanReference(type = UserFinder.class)
269            protected UserFinder userFinder;
270    }