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.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                    IdentifiableBean {
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 com.liferay.portlet.announcements.service.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                    com.liferay.portlet.announcements.service.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 Spring bean ID for this bean.
214             *
215             * @return the Spring bean ID for this bean
216             */
217            @Override
218            public String getBeanIdentifier() {
219                    return _beanIdentifier;
220            }
221    
222            /**
223             * Sets the Spring bean ID for this bean.
224             *
225             * @param beanIdentifier the Spring bean ID for this bean
226             */
227            @Override
228            public void setBeanIdentifier(String beanIdentifier) {
229                    _beanIdentifier = beanIdentifier;
230            }
231    
232            protected Class<?> getModelClass() {
233                    return AnnouncementsDelivery.class;
234            }
235    
236            protected String getModelClassName() {
237                    return AnnouncementsDelivery.class.getName();
238            }
239    
240            /**
241             * Performs a SQL query.
242             *
243             * @param sql the sql query
244             */
245            protected void runSQL(String sql) {
246                    try {
247                            DataSource dataSource = announcementsDeliveryPersistence.getDataSource();
248    
249                            DB db = DBFactoryUtil.getDB();
250    
251                            sql = db.buildSQL(sql);
252                            sql = PortalUtil.transformSQL(sql);
253    
254                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
255                                            sql, new int[0]);
256    
257                            sqlUpdate.update();
258                    }
259                    catch (Exception e) {
260                            throw new SystemException(e);
261                    }
262            }
263    
264            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService.class)
265            protected com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
266            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryService.class)
267            protected com.liferay.portlet.announcements.service.AnnouncementsDeliveryService announcementsDeliveryService;
268            @BeanReference(type = AnnouncementsDeliveryPersistence.class)
269            protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
270            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
271            protected com.liferay.counter.service.CounterLocalService counterLocalService;
272            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
273            protected com.liferay.portal.service.UserLocalService userLocalService;
274            @BeanReference(type = com.liferay.portal.service.UserService.class)
275            protected com.liferay.portal.service.UserService userService;
276            @BeanReference(type = UserPersistence.class)
277            protected UserPersistence userPersistence;
278            @BeanReference(type = UserFinder.class)
279            protected UserFinder userFinder;
280            private String _beanIdentifier;
281    }