1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.announcements.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.PortalException;
21  import com.liferay.portal.SystemException;
22  import com.liferay.portal.kernel.annotation.BeanReference;
23  import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
24  import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
25  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
26  import com.liferay.portal.kernel.util.OrderByComparator;
27  import com.liferay.portal.service.ResourceLocalService;
28  import com.liferay.portal.service.ResourceService;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.UserService;
31  import com.liferay.portal.service.persistence.ResourceFinder;
32  import com.liferay.portal.service.persistence.ResourcePersistence;
33  import com.liferay.portal.service.persistence.UserFinder;
34  import com.liferay.portal.service.persistence.UserPersistence;
35  
36  import com.liferay.portlet.announcements.model.AnnouncementsDelivery;
37  import com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService;
38  import com.liferay.portlet.announcements.service.AnnouncementsDeliveryService;
39  import com.liferay.portlet.announcements.service.AnnouncementsEntryLocalService;
40  import com.liferay.portlet.announcements.service.AnnouncementsEntryService;
41  import com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService;
42  import com.liferay.portlet.announcements.service.AnnouncementsFlagService;
43  import com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistence;
44  import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryFinder;
45  import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryPersistence;
46  import com.liferay.portlet.announcements.service.persistence.AnnouncementsFlagPersistence;
47  
48  import java.util.List;
49  
50  import javax.sql.DataSource;
51  
52  /**
53   * <a href="AnnouncementsDeliveryLocalServiceBaseImpl.java.html"><b><i>View
54   * Source</i></b></a>
55   *
56   * @author Brian Wing Shun Chan
57   */
58  public abstract class AnnouncementsDeliveryLocalServiceBaseImpl
59      implements AnnouncementsDeliveryLocalService {
60      public AnnouncementsDelivery addAnnouncementsDelivery(
61          AnnouncementsDelivery announcementsDelivery) throws SystemException {
62          announcementsDelivery.setNew(true);
63  
64          return announcementsDeliveryPersistence.update(announcementsDelivery,
65              false);
66      }
67  
68      public AnnouncementsDelivery createAnnouncementsDelivery(long deliveryId) {
69          return announcementsDeliveryPersistence.create(deliveryId);
70      }
71  
72      public void deleteAnnouncementsDelivery(long deliveryId)
73          throws PortalException, SystemException {
74          announcementsDeliveryPersistence.remove(deliveryId);
75      }
76  
77      public void deleteAnnouncementsDelivery(
78          AnnouncementsDelivery announcementsDelivery) throws SystemException {
79          announcementsDeliveryPersistence.remove(announcementsDelivery);
80      }
81  
82      @SuppressWarnings("rawtypes")
83      public List dynamicQuery(DynamicQuery dynamicQuery)
84          throws SystemException {
85          return announcementsDeliveryPersistence.findWithDynamicQuery(dynamicQuery);
86      }
87  
88      @SuppressWarnings("rawtypes")
89      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
90          throws SystemException {
91          return announcementsDeliveryPersistence.findWithDynamicQuery(dynamicQuery,
92              start, end);
93      }
94  
95      @SuppressWarnings("rawtypes")
96      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
97          OrderByComparator orderByComparator) throws SystemException {
98          return announcementsDeliveryPersistence.findWithDynamicQuery(dynamicQuery,
99              start, end, orderByComparator);
100     }
101 
102     public int dynamicQueryCount(DynamicQuery dynamicQuery)
103         throws SystemException {
104         return announcementsDeliveryPersistence.countWithDynamicQuery(dynamicQuery);
105     }
106 
107     public AnnouncementsDelivery getAnnouncementsDelivery(long deliveryId)
108         throws PortalException, SystemException {
109         return announcementsDeliveryPersistence.findByPrimaryKey(deliveryId);
110     }
111 
112     public List<AnnouncementsDelivery> getAnnouncementsDeliveries(int start,
113         int end) throws SystemException {
114         return announcementsDeliveryPersistence.findAll(start, end);
115     }
116 
117     public int getAnnouncementsDeliveriesCount() throws SystemException {
118         return announcementsDeliveryPersistence.countAll();
119     }
120 
121     public AnnouncementsDelivery updateAnnouncementsDelivery(
122         AnnouncementsDelivery announcementsDelivery) throws SystemException {
123         announcementsDelivery.setNew(false);
124 
125         return announcementsDeliveryPersistence.update(announcementsDelivery,
126             true);
127     }
128 
129     public AnnouncementsDelivery updateAnnouncementsDelivery(
130         AnnouncementsDelivery announcementsDelivery, boolean merge)
131         throws SystemException {
132         announcementsDelivery.setNew(false);
133 
134         return announcementsDeliveryPersistence.update(announcementsDelivery,
135             merge);
136     }
137 
138     public AnnouncementsDeliveryLocalService getAnnouncementsDeliveryLocalService() {
139         return announcementsDeliveryLocalService;
140     }
141 
142     public void setAnnouncementsDeliveryLocalService(
143         AnnouncementsDeliveryLocalService announcementsDeliveryLocalService) {
144         this.announcementsDeliveryLocalService = announcementsDeliveryLocalService;
145     }
146 
147     public AnnouncementsDeliveryService getAnnouncementsDeliveryService() {
148         return announcementsDeliveryService;
149     }
150 
151     public void setAnnouncementsDeliveryService(
152         AnnouncementsDeliveryService announcementsDeliveryService) {
153         this.announcementsDeliveryService = announcementsDeliveryService;
154     }
155 
156     public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
157         return announcementsDeliveryPersistence;
158     }
159 
160     public void setAnnouncementsDeliveryPersistence(
161         AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
162         this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
163     }
164 
165     public AnnouncementsEntryLocalService getAnnouncementsEntryLocalService() {
166         return announcementsEntryLocalService;
167     }
168 
169     public void setAnnouncementsEntryLocalService(
170         AnnouncementsEntryLocalService announcementsEntryLocalService) {
171         this.announcementsEntryLocalService = announcementsEntryLocalService;
172     }
173 
174     public AnnouncementsEntryService getAnnouncementsEntryService() {
175         return announcementsEntryService;
176     }
177 
178     public void setAnnouncementsEntryService(
179         AnnouncementsEntryService announcementsEntryService) {
180         this.announcementsEntryService = announcementsEntryService;
181     }
182 
183     public AnnouncementsEntryPersistence getAnnouncementsEntryPersistence() {
184         return announcementsEntryPersistence;
185     }
186 
187     public void setAnnouncementsEntryPersistence(
188         AnnouncementsEntryPersistence announcementsEntryPersistence) {
189         this.announcementsEntryPersistence = announcementsEntryPersistence;
190     }
191 
192     public AnnouncementsEntryFinder getAnnouncementsEntryFinder() {
193         return announcementsEntryFinder;
194     }
195 
196     public void setAnnouncementsEntryFinder(
197         AnnouncementsEntryFinder announcementsEntryFinder) {
198         this.announcementsEntryFinder = announcementsEntryFinder;
199     }
200 
201     public AnnouncementsFlagLocalService getAnnouncementsFlagLocalService() {
202         return announcementsFlagLocalService;
203     }
204 
205     public void setAnnouncementsFlagLocalService(
206         AnnouncementsFlagLocalService announcementsFlagLocalService) {
207         this.announcementsFlagLocalService = announcementsFlagLocalService;
208     }
209 
210     public AnnouncementsFlagService getAnnouncementsFlagService() {
211         return announcementsFlagService;
212     }
213 
214     public void setAnnouncementsFlagService(
215         AnnouncementsFlagService announcementsFlagService) {
216         this.announcementsFlagService = announcementsFlagService;
217     }
218 
219     public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
220         return announcementsFlagPersistence;
221     }
222 
223     public void setAnnouncementsFlagPersistence(
224         AnnouncementsFlagPersistence announcementsFlagPersistence) {
225         this.announcementsFlagPersistence = announcementsFlagPersistence;
226     }
227 
228     public CounterLocalService getCounterLocalService() {
229         return counterLocalService;
230     }
231 
232     public void setCounterLocalService(CounterLocalService counterLocalService) {
233         this.counterLocalService = counterLocalService;
234     }
235 
236     public CounterService getCounterService() {
237         return counterService;
238     }
239 
240     public void setCounterService(CounterService counterService) {
241         this.counterService = counterService;
242     }
243 
244     public ResourceLocalService getResourceLocalService() {
245         return resourceLocalService;
246     }
247 
248     public void setResourceLocalService(
249         ResourceLocalService resourceLocalService) {
250         this.resourceLocalService = resourceLocalService;
251     }
252 
253     public ResourceService getResourceService() {
254         return resourceService;
255     }
256 
257     public void setResourceService(ResourceService resourceService) {
258         this.resourceService = resourceService;
259     }
260 
261     public ResourcePersistence getResourcePersistence() {
262         return resourcePersistence;
263     }
264 
265     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
266         this.resourcePersistence = resourcePersistence;
267     }
268 
269     public ResourceFinder getResourceFinder() {
270         return resourceFinder;
271     }
272 
273     public void setResourceFinder(ResourceFinder resourceFinder) {
274         this.resourceFinder = resourceFinder;
275     }
276 
277     public UserLocalService getUserLocalService() {
278         return userLocalService;
279     }
280 
281     public void setUserLocalService(UserLocalService userLocalService) {
282         this.userLocalService = userLocalService;
283     }
284 
285     public UserService getUserService() {
286         return userService;
287     }
288 
289     public void setUserService(UserService userService) {
290         this.userService = userService;
291     }
292 
293     public UserPersistence getUserPersistence() {
294         return userPersistence;
295     }
296 
297     public void setUserPersistence(UserPersistence userPersistence) {
298         this.userPersistence = userPersistence;
299     }
300 
301     public UserFinder getUserFinder() {
302         return userFinder;
303     }
304 
305     public void setUserFinder(UserFinder userFinder) {
306         this.userFinder = userFinder;
307     }
308 
309     protected void runSQL(String sql) throws SystemException {
310         try {
311             DataSource dataSource = announcementsDeliveryPersistence.getDataSource();
312 
313             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
314                     sql, new int[0]);
315 
316             sqlUpdate.update(new Object[0]);
317         }
318         catch (Exception e) {
319             throw new SystemException(e);
320         }
321     }
322 
323     @BeanReference(type = AnnouncementsDeliveryLocalService.class)
324     protected AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
325     @BeanReference(type = AnnouncementsDeliveryService.class)
326     protected AnnouncementsDeliveryService announcementsDeliveryService;
327     @BeanReference(type = AnnouncementsDeliveryPersistence.class)
328     protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
329     @BeanReference(type = AnnouncementsEntryLocalService.class)
330     protected AnnouncementsEntryLocalService announcementsEntryLocalService;
331     @BeanReference(type = AnnouncementsEntryService.class)
332     protected AnnouncementsEntryService announcementsEntryService;
333     @BeanReference(type = AnnouncementsEntryPersistence.class)
334     protected AnnouncementsEntryPersistence announcementsEntryPersistence;
335     @BeanReference(type = AnnouncementsEntryFinder.class)
336     protected AnnouncementsEntryFinder announcementsEntryFinder;
337     @BeanReference(type = AnnouncementsFlagLocalService.class)
338     protected AnnouncementsFlagLocalService announcementsFlagLocalService;
339     @BeanReference(type = AnnouncementsFlagService.class)
340     protected AnnouncementsFlagService announcementsFlagService;
341     @BeanReference(type = AnnouncementsFlagPersistence.class)
342     protected AnnouncementsFlagPersistence announcementsFlagPersistence;
343     @BeanReference(type = CounterLocalService.class)
344     protected CounterLocalService counterLocalService;
345     @BeanReference(type = CounterService.class)
346     protected CounterService counterService;
347     @BeanReference(type = ResourceLocalService.class)
348     protected ResourceLocalService resourceLocalService;
349     @BeanReference(type = ResourceService.class)
350     protected ResourceService resourceService;
351     @BeanReference(type = ResourcePersistence.class)
352     protected ResourcePersistence resourcePersistence;
353     @BeanReference(type = ResourceFinder.class)
354     protected ResourceFinder resourceFinder;
355     @BeanReference(type = UserLocalService.class)
356     protected UserLocalService userLocalService;
357     @BeanReference(type = UserService.class)
358     protected UserService userService;
359     @BeanReference(type = UserPersistence.class)
360     protected UserPersistence userPersistence;
361     @BeanReference(type = UserFinder.class)
362     protected UserFinder userFinder;
363 }