001    /**
002     * Copyright (c) 2000-2010 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.tasks.service.base;
016    
017    import com.liferay.counter.service.CounterLocalService;
018    
019    import com.liferay.portal.kernel.annotation.BeanReference;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023    import com.liferay.portal.kernel.exception.PortalException;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.util.OrderByComparator;
026    import com.liferay.portal.service.ResourceLocalService;
027    import com.liferay.portal.service.ResourceService;
028    import com.liferay.portal.service.UserLocalService;
029    import com.liferay.portal.service.UserService;
030    import com.liferay.portal.service.persistence.ResourceFinder;
031    import com.liferay.portal.service.persistence.ResourcePersistence;
032    import com.liferay.portal.service.persistence.UserFinder;
033    import com.liferay.portal.service.persistence.UserPersistence;
034    
035    import com.liferay.portlet.social.service.SocialActivityLocalService;
036    import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
037    import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
038    import com.liferay.portlet.tasks.model.TasksReview;
039    import com.liferay.portlet.tasks.service.TasksProposalLocalService;
040    import com.liferay.portlet.tasks.service.TasksProposalService;
041    import com.liferay.portlet.tasks.service.TasksReviewLocalService;
042    import com.liferay.portlet.tasks.service.TasksReviewService;
043    import com.liferay.portlet.tasks.service.persistence.TasksProposalFinder;
044    import com.liferay.portlet.tasks.service.persistence.TasksProposalPersistence;
045    import com.liferay.portlet.tasks.service.persistence.TasksReviewPersistence;
046    
047    import java.util.List;
048    
049    import javax.sql.DataSource;
050    
051    /**
052     * The base implementation of the tasks review local service.
053     *
054     * <p>
055     * 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.tasks.service.impl.TasksReviewLocalServiceImpl}.
056     * </p>
057     *
058     * <p>
059     * Never modify or reference this class directly. Always use {@link com.liferay.portlet.tasks.service.TasksReviewLocalServiceUtil} to access the tasks review local service.
060     * </p>
061     *
062     * @author Brian Wing Shun Chan
063     * @see com.liferay.portlet.tasks.service.impl.TasksReviewLocalServiceImpl
064     * @see com.liferay.portlet.tasks.service.TasksReviewLocalServiceUtil
065     * @generated
066     */
067    public abstract class TasksReviewLocalServiceBaseImpl
068            implements TasksReviewLocalService {
069            /**
070             * Adds the tasks review to the database. Also notifies the appropriate model listeners.
071             *
072             * @param tasksReview the tasks review to add
073             * @return the tasks review that was added
074             * @throws SystemException if a system exception occurred
075             */
076            public TasksReview addTasksReview(TasksReview tasksReview)
077                    throws SystemException {
078                    tasksReview.setNew(true);
079    
080                    return tasksReviewPersistence.update(tasksReview, false);
081            }
082    
083            /**
084             * Creates a new tasks review with the primary key. Does not add the tasks review to the database.
085             *
086             * @param reviewId the primary key for the new tasks review
087             * @return the new tasks review
088             */
089            public TasksReview createTasksReview(long reviewId) {
090                    return tasksReviewPersistence.create(reviewId);
091            }
092    
093            /**
094             * Deletes the tasks review with the primary key from the database. Also notifies the appropriate model listeners.
095             *
096             * @param reviewId the primary key of the tasks review to delete
097             * @throws PortalException if a tasks review with the primary key could not be found
098             * @throws SystemException if a system exception occurred
099             */
100            public void deleteTasksReview(long reviewId)
101                    throws PortalException, SystemException {
102                    tasksReviewPersistence.remove(reviewId);
103            }
104    
105            /**
106             * Deletes the tasks review from the database. Also notifies the appropriate model listeners.
107             *
108             * @param tasksReview the tasks review to delete
109             * @throws SystemException if a system exception occurred
110             */
111            public void deleteTasksReview(TasksReview tasksReview)
112                    throws SystemException {
113                    tasksReviewPersistence.remove(tasksReview);
114            }
115    
116            /**
117             * Performs a dynamic query on the database and returns the matching rows.
118             *
119             * @param dynamicQuery the dynamic query to search with
120             * @return the matching rows
121             * @throws SystemException if a system exception occurred
122             */
123            @SuppressWarnings("rawtypes")
124            public List dynamicQuery(DynamicQuery dynamicQuery)
125                    throws SystemException {
126                    return tasksReviewPersistence.findWithDynamicQuery(dynamicQuery);
127            }
128    
129            /**
130             * Performs a dynamic query on the database and returns a range of the matching rows.
131             *
132             * <p>
133             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
134             * </p>
135             *
136             * @param dynamicQuery the dynamic query to search with
137             * @param start the lower bound of the range of model instances to return
138             * @param end the upper bound of the range of model instances to return (not inclusive)
139             * @return the range of matching rows
140             * @throws SystemException if a system exception occurred
141             */
142            @SuppressWarnings("rawtypes")
143            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
144                    throws SystemException {
145                    return tasksReviewPersistence.findWithDynamicQuery(dynamicQuery, start,
146                            end);
147            }
148    
149            /**
150             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
151             *
152             * <p>
153             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
154             * </p>
155             *
156             * @param dynamicQuery the dynamic query to search with
157             * @param start the lower bound of the range of model instances to return
158             * @param end the upper bound of the range of model instances to return (not inclusive)
159             * @param orderByComparator the comparator to order the results by
160             * @return the ordered range of matching rows
161             * @throws SystemException if a system exception occurred
162             */
163            @SuppressWarnings("rawtypes")
164            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
165                    OrderByComparator orderByComparator) throws SystemException {
166                    return tasksReviewPersistence.findWithDynamicQuery(dynamicQuery, start,
167                            end, orderByComparator);
168            }
169    
170            /**
171             * Counts the number of rows that match the dynamic query.
172             *
173             * @param dynamicQuery the dynamic query to search with
174             * @return the number of rows that match the dynamic query
175             * @throws SystemException if a system exception occurred
176             */
177            public long dynamicQueryCount(DynamicQuery dynamicQuery)
178                    throws SystemException {
179                    return tasksReviewPersistence.countWithDynamicQuery(dynamicQuery);
180            }
181    
182            /**
183             * Gets the tasks review with the primary key.
184             *
185             * @param reviewId the primary key of the tasks review to get
186             * @return the tasks review
187             * @throws PortalException if a tasks review with the primary key could not be found
188             * @throws SystemException if a system exception occurred
189             */
190            public TasksReview getTasksReview(long reviewId)
191                    throws PortalException, SystemException {
192                    return tasksReviewPersistence.findByPrimaryKey(reviewId);
193            }
194    
195            /**
196             * Gets a range of all the tasks reviews.
197             *
198             * <p>
199             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
200             * </p>
201             *
202             * @param start the lower bound of the range of tasks reviews to return
203             * @param end the upper bound of the range of tasks reviews to return (not inclusive)
204             * @return the range of tasks reviews
205             * @throws SystemException if a system exception occurred
206             */
207            public List<TasksReview> getTasksReviews(int start, int end)
208                    throws SystemException {
209                    return tasksReviewPersistence.findAll(start, end);
210            }
211    
212            /**
213             * Gets the number of tasks reviews.
214             *
215             * @return the number of tasks reviews
216             * @throws SystemException if a system exception occurred
217             */
218            public int getTasksReviewsCount() throws SystemException {
219                    return tasksReviewPersistence.countAll();
220            }
221    
222            /**
223             * Updates the tasks review in the database. Also notifies the appropriate model listeners.
224             *
225             * @param tasksReview the tasks review to update
226             * @return the tasks review that was updated
227             * @throws SystemException if a system exception occurred
228             */
229            public TasksReview updateTasksReview(TasksReview tasksReview)
230                    throws SystemException {
231                    tasksReview.setNew(false);
232    
233                    return tasksReviewPersistence.update(tasksReview, true);
234            }
235    
236            /**
237             * Updates the tasks review in the database. Also notifies the appropriate model listeners.
238             *
239             * @param tasksReview the tasks review to update
240             * @param merge whether to merge the tasks review with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
241             * @return the tasks review that was updated
242             * @throws SystemException if a system exception occurred
243             */
244            public TasksReview updateTasksReview(TasksReview tasksReview, boolean merge)
245                    throws SystemException {
246                    tasksReview.setNew(false);
247    
248                    return tasksReviewPersistence.update(tasksReview, merge);
249            }
250    
251            /**
252             * Gets the tasks proposal local service.
253             *
254             * @return the tasks proposal local service
255             */
256            public TasksProposalLocalService getTasksProposalLocalService() {
257                    return tasksProposalLocalService;
258            }
259    
260            /**
261             * Sets the tasks proposal local service.
262             *
263             * @param tasksProposalLocalService the tasks proposal local service
264             */
265            public void setTasksProposalLocalService(
266                    TasksProposalLocalService tasksProposalLocalService) {
267                    this.tasksProposalLocalService = tasksProposalLocalService;
268            }
269    
270            /**
271             * Gets the tasks proposal remote service.
272             *
273             * @return the tasks proposal remote service
274             */
275            public TasksProposalService getTasksProposalService() {
276                    return tasksProposalService;
277            }
278    
279            /**
280             * Sets the tasks proposal remote service.
281             *
282             * @param tasksProposalService the tasks proposal remote service
283             */
284            public void setTasksProposalService(
285                    TasksProposalService tasksProposalService) {
286                    this.tasksProposalService = tasksProposalService;
287            }
288    
289            /**
290             * Gets the tasks proposal persistence.
291             *
292             * @return the tasks proposal persistence
293             */
294            public TasksProposalPersistence getTasksProposalPersistence() {
295                    return tasksProposalPersistence;
296            }
297    
298            /**
299             * Sets the tasks proposal persistence.
300             *
301             * @param tasksProposalPersistence the tasks proposal persistence
302             */
303            public void setTasksProposalPersistence(
304                    TasksProposalPersistence tasksProposalPersistence) {
305                    this.tasksProposalPersistence = tasksProposalPersistence;
306            }
307    
308            /**
309             * Gets the tasks proposal finder.
310             *
311             * @return the tasks proposal finder
312             */
313            public TasksProposalFinder getTasksProposalFinder() {
314                    return tasksProposalFinder;
315            }
316    
317            /**
318             * Sets the tasks proposal finder.
319             *
320             * @param tasksProposalFinder the tasks proposal finder
321             */
322            public void setTasksProposalFinder(TasksProposalFinder tasksProposalFinder) {
323                    this.tasksProposalFinder = tasksProposalFinder;
324            }
325    
326            /**
327             * Gets the tasks review local service.
328             *
329             * @return the tasks review local service
330             */
331            public TasksReviewLocalService getTasksReviewLocalService() {
332                    return tasksReviewLocalService;
333            }
334    
335            /**
336             * Sets the tasks review local service.
337             *
338             * @param tasksReviewLocalService the tasks review local service
339             */
340            public void setTasksReviewLocalService(
341                    TasksReviewLocalService tasksReviewLocalService) {
342                    this.tasksReviewLocalService = tasksReviewLocalService;
343            }
344    
345            /**
346             * Gets the tasks review remote service.
347             *
348             * @return the tasks review remote service
349             */
350            public TasksReviewService getTasksReviewService() {
351                    return tasksReviewService;
352            }
353    
354            /**
355             * Sets the tasks review remote service.
356             *
357             * @param tasksReviewService the tasks review remote service
358             */
359            public void setTasksReviewService(TasksReviewService tasksReviewService) {
360                    this.tasksReviewService = tasksReviewService;
361            }
362    
363            /**
364             * Gets the tasks review persistence.
365             *
366             * @return the tasks review persistence
367             */
368            public TasksReviewPersistence getTasksReviewPersistence() {
369                    return tasksReviewPersistence;
370            }
371    
372            /**
373             * Sets the tasks review persistence.
374             *
375             * @param tasksReviewPersistence the tasks review persistence
376             */
377            public void setTasksReviewPersistence(
378                    TasksReviewPersistence tasksReviewPersistence) {
379                    this.tasksReviewPersistence = tasksReviewPersistence;
380            }
381    
382            /**
383             * Gets the counter local service.
384             *
385             * @return the counter local service
386             */
387            public CounterLocalService getCounterLocalService() {
388                    return counterLocalService;
389            }
390    
391            /**
392             * Sets the counter local service.
393             *
394             * @param counterLocalService the counter local service
395             */
396            public void setCounterLocalService(CounterLocalService counterLocalService) {
397                    this.counterLocalService = counterLocalService;
398            }
399    
400            /**
401             * Gets the resource local service.
402             *
403             * @return the resource local service
404             */
405            public ResourceLocalService getResourceLocalService() {
406                    return resourceLocalService;
407            }
408    
409            /**
410             * Sets the resource local service.
411             *
412             * @param resourceLocalService the resource local service
413             */
414            public void setResourceLocalService(
415                    ResourceLocalService resourceLocalService) {
416                    this.resourceLocalService = resourceLocalService;
417            }
418    
419            /**
420             * Gets the resource remote service.
421             *
422             * @return the resource remote service
423             */
424            public ResourceService getResourceService() {
425                    return resourceService;
426            }
427    
428            /**
429             * Sets the resource remote service.
430             *
431             * @param resourceService the resource remote service
432             */
433            public void setResourceService(ResourceService resourceService) {
434                    this.resourceService = resourceService;
435            }
436    
437            /**
438             * Gets the resource persistence.
439             *
440             * @return the resource persistence
441             */
442            public ResourcePersistence getResourcePersistence() {
443                    return resourcePersistence;
444            }
445    
446            /**
447             * Sets the resource persistence.
448             *
449             * @param resourcePersistence the resource persistence
450             */
451            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
452                    this.resourcePersistence = resourcePersistence;
453            }
454    
455            /**
456             * Gets the resource finder.
457             *
458             * @return the resource finder
459             */
460            public ResourceFinder getResourceFinder() {
461                    return resourceFinder;
462            }
463    
464            /**
465             * Sets the resource finder.
466             *
467             * @param resourceFinder the resource finder
468             */
469            public void setResourceFinder(ResourceFinder resourceFinder) {
470                    this.resourceFinder = resourceFinder;
471            }
472    
473            /**
474             * Gets the user local service.
475             *
476             * @return the user local service
477             */
478            public UserLocalService getUserLocalService() {
479                    return userLocalService;
480            }
481    
482            /**
483             * Sets the user local service.
484             *
485             * @param userLocalService the user local service
486             */
487            public void setUserLocalService(UserLocalService userLocalService) {
488                    this.userLocalService = userLocalService;
489            }
490    
491            /**
492             * Gets the user remote service.
493             *
494             * @return the user remote service
495             */
496            public UserService getUserService() {
497                    return userService;
498            }
499    
500            /**
501             * Sets the user remote service.
502             *
503             * @param userService the user remote service
504             */
505            public void setUserService(UserService userService) {
506                    this.userService = userService;
507            }
508    
509            /**
510             * Gets the user persistence.
511             *
512             * @return the user persistence
513             */
514            public UserPersistence getUserPersistence() {
515                    return userPersistence;
516            }
517    
518            /**
519             * Sets the user persistence.
520             *
521             * @param userPersistence the user persistence
522             */
523            public void setUserPersistence(UserPersistence userPersistence) {
524                    this.userPersistence = userPersistence;
525            }
526    
527            /**
528             * Gets the user finder.
529             *
530             * @return the user finder
531             */
532            public UserFinder getUserFinder() {
533                    return userFinder;
534            }
535    
536            /**
537             * Sets the user finder.
538             *
539             * @param userFinder the user finder
540             */
541            public void setUserFinder(UserFinder userFinder) {
542                    this.userFinder = userFinder;
543            }
544    
545            /**
546             * Gets the social activity local service.
547             *
548             * @return the social activity local service
549             */
550            public SocialActivityLocalService getSocialActivityLocalService() {
551                    return socialActivityLocalService;
552            }
553    
554            /**
555             * Sets the social activity local service.
556             *
557             * @param socialActivityLocalService the social activity local service
558             */
559            public void setSocialActivityLocalService(
560                    SocialActivityLocalService socialActivityLocalService) {
561                    this.socialActivityLocalService = socialActivityLocalService;
562            }
563    
564            /**
565             * Gets the social activity persistence.
566             *
567             * @return the social activity persistence
568             */
569            public SocialActivityPersistence getSocialActivityPersistence() {
570                    return socialActivityPersistence;
571            }
572    
573            /**
574             * Sets the social activity persistence.
575             *
576             * @param socialActivityPersistence the social activity persistence
577             */
578            public void setSocialActivityPersistence(
579                    SocialActivityPersistence socialActivityPersistence) {
580                    this.socialActivityPersistence = socialActivityPersistence;
581            }
582    
583            /**
584             * Gets the social activity finder.
585             *
586             * @return the social activity finder
587             */
588            public SocialActivityFinder getSocialActivityFinder() {
589                    return socialActivityFinder;
590            }
591    
592            /**
593             * Sets the social activity finder.
594             *
595             * @param socialActivityFinder the social activity finder
596             */
597            public void setSocialActivityFinder(
598                    SocialActivityFinder socialActivityFinder) {
599                    this.socialActivityFinder = socialActivityFinder;
600            }
601    
602            /**
603             * Performs an SQL query.
604             *
605             * @param sql the sql query to perform
606             */
607            protected void runSQL(String sql) throws SystemException {
608                    try {
609                            DataSource dataSource = tasksReviewPersistence.getDataSource();
610    
611                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
612                                            sql, new int[0]);
613    
614                            sqlUpdate.update();
615                    }
616                    catch (Exception e) {
617                            throw new SystemException(e);
618                    }
619            }
620    
621            @BeanReference(type = TasksProposalLocalService.class)
622            protected TasksProposalLocalService tasksProposalLocalService;
623            @BeanReference(type = TasksProposalService.class)
624            protected TasksProposalService tasksProposalService;
625            @BeanReference(type = TasksProposalPersistence.class)
626            protected TasksProposalPersistence tasksProposalPersistence;
627            @BeanReference(type = TasksProposalFinder.class)
628            protected TasksProposalFinder tasksProposalFinder;
629            @BeanReference(type = TasksReviewLocalService.class)
630            protected TasksReviewLocalService tasksReviewLocalService;
631            @BeanReference(type = TasksReviewService.class)
632            protected TasksReviewService tasksReviewService;
633            @BeanReference(type = TasksReviewPersistence.class)
634            protected TasksReviewPersistence tasksReviewPersistence;
635            @BeanReference(type = CounterLocalService.class)
636            protected CounterLocalService counterLocalService;
637            @BeanReference(type = ResourceLocalService.class)
638            protected ResourceLocalService resourceLocalService;
639            @BeanReference(type = ResourceService.class)
640            protected ResourceService resourceService;
641            @BeanReference(type = ResourcePersistence.class)
642            protected ResourcePersistence resourcePersistence;
643            @BeanReference(type = ResourceFinder.class)
644            protected ResourceFinder resourceFinder;
645            @BeanReference(type = UserLocalService.class)
646            protected UserLocalService userLocalService;
647            @BeanReference(type = UserService.class)
648            protected UserService userService;
649            @BeanReference(type = UserPersistence.class)
650            protected UserPersistence userPersistence;
651            @BeanReference(type = UserFinder.class)
652            protected UserFinder userFinder;
653            @BeanReference(type = SocialActivityLocalService.class)
654            protected SocialActivityLocalService socialActivityLocalService;
655            @BeanReference(type = SocialActivityPersistence.class)
656            protected SocialActivityPersistence socialActivityPersistence;
657            @BeanReference(type = SocialActivityFinder.class)
658            protected SocialActivityFinder socialActivityFinder;
659    }