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.tasks.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.messageboards.service.MBMessageLocalService;
37  import com.liferay.portlet.messageboards.service.MBMessageService;
38  import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
39  import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
40  import com.liferay.portlet.social.service.SocialActivityLocalService;
41  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
42  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
43  import com.liferay.portlet.tasks.model.TasksProposal;
44  import com.liferay.portlet.tasks.service.TasksProposalLocalService;
45  import com.liferay.portlet.tasks.service.TasksProposalService;
46  import com.liferay.portlet.tasks.service.TasksReviewLocalService;
47  import com.liferay.portlet.tasks.service.TasksReviewService;
48  import com.liferay.portlet.tasks.service.persistence.TasksProposalFinder;
49  import com.liferay.portlet.tasks.service.persistence.TasksProposalPersistence;
50  import com.liferay.portlet.tasks.service.persistence.TasksReviewPersistence;
51  
52  import java.util.List;
53  
54  import javax.sql.DataSource;
55  
56  /**
57   * <a href="TasksProposalLocalServiceBaseImpl.java.html"><b><i>View Source</i>
58   * </b></a>
59   *
60   * @author Brian Wing Shun Chan
61   */
62  public abstract class TasksProposalLocalServiceBaseImpl
63      implements TasksProposalLocalService {
64      public TasksProposal addTasksProposal(TasksProposal tasksProposal)
65          throws SystemException {
66          tasksProposal.setNew(true);
67  
68          return tasksProposalPersistence.update(tasksProposal, false);
69      }
70  
71      public TasksProposal createTasksProposal(long proposalId) {
72          return tasksProposalPersistence.create(proposalId);
73      }
74  
75      public void deleteTasksProposal(long proposalId)
76          throws PortalException, SystemException {
77          tasksProposalPersistence.remove(proposalId);
78      }
79  
80      public void deleteTasksProposal(TasksProposal tasksProposal)
81          throws SystemException {
82          tasksProposalPersistence.remove(tasksProposal);
83      }
84  
85      @SuppressWarnings("rawtypes")
86      public List dynamicQuery(DynamicQuery dynamicQuery)
87          throws SystemException {
88          return tasksProposalPersistence.findWithDynamicQuery(dynamicQuery);
89      }
90  
91      @SuppressWarnings("rawtypes")
92      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
93          throws SystemException {
94          return tasksProposalPersistence.findWithDynamicQuery(dynamicQuery,
95              start, end);
96      }
97  
98      @SuppressWarnings("rawtypes")
99      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
100         OrderByComparator orderByComparator) throws SystemException {
101         return tasksProposalPersistence.findWithDynamicQuery(dynamicQuery,
102             start, end, orderByComparator);
103     }
104 
105     public int dynamicQueryCount(DynamicQuery dynamicQuery)
106         throws SystemException {
107         return tasksProposalPersistence.countWithDynamicQuery(dynamicQuery);
108     }
109 
110     public TasksProposal getTasksProposal(long proposalId)
111         throws PortalException, SystemException {
112         return tasksProposalPersistence.findByPrimaryKey(proposalId);
113     }
114 
115     public List<TasksProposal> getTasksProposals(int start, int end)
116         throws SystemException {
117         return tasksProposalPersistence.findAll(start, end);
118     }
119 
120     public int getTasksProposalsCount() throws SystemException {
121         return tasksProposalPersistence.countAll();
122     }
123 
124     public TasksProposal updateTasksProposal(TasksProposal tasksProposal)
125         throws SystemException {
126         tasksProposal.setNew(false);
127 
128         return tasksProposalPersistence.update(tasksProposal, true);
129     }
130 
131     public TasksProposal updateTasksProposal(TasksProposal tasksProposal,
132         boolean merge) throws SystemException {
133         tasksProposal.setNew(false);
134 
135         return tasksProposalPersistence.update(tasksProposal, merge);
136     }
137 
138     public TasksProposalLocalService getTasksProposalLocalService() {
139         return tasksProposalLocalService;
140     }
141 
142     public void setTasksProposalLocalService(
143         TasksProposalLocalService tasksProposalLocalService) {
144         this.tasksProposalLocalService = tasksProposalLocalService;
145     }
146 
147     public TasksProposalService getTasksProposalService() {
148         return tasksProposalService;
149     }
150 
151     public void setTasksProposalService(
152         TasksProposalService tasksProposalService) {
153         this.tasksProposalService = tasksProposalService;
154     }
155 
156     public TasksProposalPersistence getTasksProposalPersistence() {
157         return tasksProposalPersistence;
158     }
159 
160     public void setTasksProposalPersistence(
161         TasksProposalPersistence tasksProposalPersistence) {
162         this.tasksProposalPersistence = tasksProposalPersistence;
163     }
164 
165     public TasksProposalFinder getTasksProposalFinder() {
166         return tasksProposalFinder;
167     }
168 
169     public void setTasksProposalFinder(TasksProposalFinder tasksProposalFinder) {
170         this.tasksProposalFinder = tasksProposalFinder;
171     }
172 
173     public TasksReviewLocalService getTasksReviewLocalService() {
174         return tasksReviewLocalService;
175     }
176 
177     public void setTasksReviewLocalService(
178         TasksReviewLocalService tasksReviewLocalService) {
179         this.tasksReviewLocalService = tasksReviewLocalService;
180     }
181 
182     public TasksReviewService getTasksReviewService() {
183         return tasksReviewService;
184     }
185 
186     public void setTasksReviewService(TasksReviewService tasksReviewService) {
187         this.tasksReviewService = tasksReviewService;
188     }
189 
190     public TasksReviewPersistence getTasksReviewPersistence() {
191         return tasksReviewPersistence;
192     }
193 
194     public void setTasksReviewPersistence(
195         TasksReviewPersistence tasksReviewPersistence) {
196         this.tasksReviewPersistence = tasksReviewPersistence;
197     }
198 
199     public CounterLocalService getCounterLocalService() {
200         return counterLocalService;
201     }
202 
203     public void setCounterLocalService(CounterLocalService counterLocalService) {
204         this.counterLocalService = counterLocalService;
205     }
206 
207     public CounterService getCounterService() {
208         return counterService;
209     }
210 
211     public void setCounterService(CounterService counterService) {
212         this.counterService = counterService;
213     }
214 
215     public ResourceLocalService getResourceLocalService() {
216         return resourceLocalService;
217     }
218 
219     public void setResourceLocalService(
220         ResourceLocalService resourceLocalService) {
221         this.resourceLocalService = resourceLocalService;
222     }
223 
224     public ResourceService getResourceService() {
225         return resourceService;
226     }
227 
228     public void setResourceService(ResourceService resourceService) {
229         this.resourceService = resourceService;
230     }
231 
232     public ResourcePersistence getResourcePersistence() {
233         return resourcePersistence;
234     }
235 
236     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
237         this.resourcePersistence = resourcePersistence;
238     }
239 
240     public ResourceFinder getResourceFinder() {
241         return resourceFinder;
242     }
243 
244     public void setResourceFinder(ResourceFinder resourceFinder) {
245         this.resourceFinder = resourceFinder;
246     }
247 
248     public UserLocalService getUserLocalService() {
249         return userLocalService;
250     }
251 
252     public void setUserLocalService(UserLocalService userLocalService) {
253         this.userLocalService = userLocalService;
254     }
255 
256     public UserService getUserService() {
257         return userService;
258     }
259 
260     public void setUserService(UserService userService) {
261         this.userService = userService;
262     }
263 
264     public UserPersistence getUserPersistence() {
265         return userPersistence;
266     }
267 
268     public void setUserPersistence(UserPersistence userPersistence) {
269         this.userPersistence = userPersistence;
270     }
271 
272     public UserFinder getUserFinder() {
273         return userFinder;
274     }
275 
276     public void setUserFinder(UserFinder userFinder) {
277         this.userFinder = userFinder;
278     }
279 
280     public MBMessageLocalService getMBMessageLocalService() {
281         return mbMessageLocalService;
282     }
283 
284     public void setMBMessageLocalService(
285         MBMessageLocalService mbMessageLocalService) {
286         this.mbMessageLocalService = mbMessageLocalService;
287     }
288 
289     public MBMessageService getMBMessageService() {
290         return mbMessageService;
291     }
292 
293     public void setMBMessageService(MBMessageService mbMessageService) {
294         this.mbMessageService = mbMessageService;
295     }
296 
297     public MBMessagePersistence getMBMessagePersistence() {
298         return mbMessagePersistence;
299     }
300 
301     public void setMBMessagePersistence(
302         MBMessagePersistence mbMessagePersistence) {
303         this.mbMessagePersistence = mbMessagePersistence;
304     }
305 
306     public MBMessageFinder getMBMessageFinder() {
307         return mbMessageFinder;
308     }
309 
310     public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
311         this.mbMessageFinder = mbMessageFinder;
312     }
313 
314     public SocialActivityLocalService getSocialActivityLocalService() {
315         return socialActivityLocalService;
316     }
317 
318     public void setSocialActivityLocalService(
319         SocialActivityLocalService socialActivityLocalService) {
320         this.socialActivityLocalService = socialActivityLocalService;
321     }
322 
323     public SocialActivityPersistence getSocialActivityPersistence() {
324         return socialActivityPersistence;
325     }
326 
327     public void setSocialActivityPersistence(
328         SocialActivityPersistence socialActivityPersistence) {
329         this.socialActivityPersistence = socialActivityPersistence;
330     }
331 
332     public SocialActivityFinder getSocialActivityFinder() {
333         return socialActivityFinder;
334     }
335 
336     public void setSocialActivityFinder(
337         SocialActivityFinder socialActivityFinder) {
338         this.socialActivityFinder = socialActivityFinder;
339     }
340 
341     protected void runSQL(String sql) throws SystemException {
342         try {
343             DataSource dataSource = tasksProposalPersistence.getDataSource();
344 
345             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
346                     sql, new int[0]);
347 
348             sqlUpdate.update(new Object[0]);
349         }
350         catch (Exception e) {
351             throw new SystemException(e);
352         }
353     }
354 
355     @BeanReference(type = TasksProposalLocalService.class)
356     protected TasksProposalLocalService tasksProposalLocalService;
357     @BeanReference(type = TasksProposalService.class)
358     protected TasksProposalService tasksProposalService;
359     @BeanReference(type = TasksProposalPersistence.class)
360     protected TasksProposalPersistence tasksProposalPersistence;
361     @BeanReference(type = TasksProposalFinder.class)
362     protected TasksProposalFinder tasksProposalFinder;
363     @BeanReference(type = TasksReviewLocalService.class)
364     protected TasksReviewLocalService tasksReviewLocalService;
365     @BeanReference(type = TasksReviewService.class)
366     protected TasksReviewService tasksReviewService;
367     @BeanReference(type = TasksReviewPersistence.class)
368     protected TasksReviewPersistence tasksReviewPersistence;
369     @BeanReference(type = CounterLocalService.class)
370     protected CounterLocalService counterLocalService;
371     @BeanReference(type = CounterService.class)
372     protected CounterService counterService;
373     @BeanReference(type = ResourceLocalService.class)
374     protected ResourceLocalService resourceLocalService;
375     @BeanReference(type = ResourceService.class)
376     protected ResourceService resourceService;
377     @BeanReference(type = ResourcePersistence.class)
378     protected ResourcePersistence resourcePersistence;
379     @BeanReference(type = ResourceFinder.class)
380     protected ResourceFinder resourceFinder;
381     @BeanReference(type = UserLocalService.class)
382     protected UserLocalService userLocalService;
383     @BeanReference(type = UserService.class)
384     protected UserService userService;
385     @BeanReference(type = UserPersistence.class)
386     protected UserPersistence userPersistence;
387     @BeanReference(type = UserFinder.class)
388     protected UserFinder userFinder;
389     @BeanReference(type = MBMessageLocalService.class)
390     protected MBMessageLocalService mbMessageLocalService;
391     @BeanReference(type = MBMessageService.class)
392     protected MBMessageService mbMessageService;
393     @BeanReference(type = MBMessagePersistence.class)
394     protected MBMessagePersistence mbMessagePersistence;
395     @BeanReference(type = MBMessageFinder.class)
396     protected MBMessageFinder mbMessageFinder;
397     @BeanReference(type = SocialActivityLocalService.class)
398     protected SocialActivityLocalService socialActivityLocalService;
399     @BeanReference(type = SocialActivityPersistence.class)
400     protected SocialActivityPersistence socialActivityPersistence;
401     @BeanReference(type = SocialActivityFinder.class)
402     protected SocialActivityFinder socialActivityFinder;
403 }