1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.ratings.service.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.annotation.BeanReference;
31  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
32  
33  import com.liferay.portlet.ratings.model.RatingsStats;
34  import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
35  import com.liferay.portlet.ratings.service.RatingsEntryService;
36  import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
37  import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
38  import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
39  
40  import java.util.List;
41  
42  /**
43   * <a href="RatingsStatsLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   */
48  public abstract class RatingsStatsLocalServiceBaseImpl
49      implements RatingsStatsLocalService {
50      public RatingsStats addRatingsStats(RatingsStats ratingsStats)
51          throws SystemException {
52          ratingsStats.setNew(true);
53  
54          return ratingsStatsPersistence.update(ratingsStats, false);
55      }
56  
57      public RatingsStats createRatingsStats(long statsId) {
58          return ratingsStatsPersistence.create(statsId);
59      }
60  
61      public void deleteRatingsStats(long statsId)
62          throws PortalException, SystemException {
63          ratingsStatsPersistence.remove(statsId);
64      }
65  
66      public void deleteRatingsStats(RatingsStats ratingsStats)
67          throws SystemException {
68          ratingsStatsPersistence.remove(ratingsStats);
69      }
70  
71      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
72          throws SystemException {
73          return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery);
74      }
75  
76      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
77          int end) throws SystemException {
78          return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery,
79              start, end);
80      }
81  
82      public RatingsStats getRatingsStats(long statsId)
83          throws PortalException, SystemException {
84          return ratingsStatsPersistence.findByPrimaryKey(statsId);
85      }
86  
87      public List<RatingsStats> getRatingsStatses(int start, int end)
88          throws SystemException {
89          return ratingsStatsPersistence.findAll(start, end);
90      }
91  
92      public int getRatingsStatsesCount() throws SystemException {
93          return ratingsStatsPersistence.countAll();
94      }
95  
96      public RatingsStats updateRatingsStats(RatingsStats ratingsStats)
97          throws SystemException {
98          ratingsStats.setNew(false);
99  
100         return ratingsStatsPersistence.update(ratingsStats, true);
101     }
102 
103     public RatingsEntryLocalService getRatingsEntryLocalService() {
104         return ratingsEntryLocalService;
105     }
106 
107     public void setRatingsEntryLocalService(
108         RatingsEntryLocalService ratingsEntryLocalService) {
109         this.ratingsEntryLocalService = ratingsEntryLocalService;
110     }
111 
112     public RatingsEntryService getRatingsEntryService() {
113         return ratingsEntryService;
114     }
115 
116     public void setRatingsEntryService(RatingsEntryService ratingsEntryService) {
117         this.ratingsEntryService = ratingsEntryService;
118     }
119 
120     public RatingsEntryPersistence getRatingsEntryPersistence() {
121         return ratingsEntryPersistence;
122     }
123 
124     public void setRatingsEntryPersistence(
125         RatingsEntryPersistence ratingsEntryPersistence) {
126         this.ratingsEntryPersistence = ratingsEntryPersistence;
127     }
128 
129     public RatingsStatsLocalService getRatingsStatsLocalService() {
130         return ratingsStatsLocalService;
131     }
132 
133     public void setRatingsStatsLocalService(
134         RatingsStatsLocalService ratingsStatsLocalService) {
135         this.ratingsStatsLocalService = ratingsStatsLocalService;
136     }
137 
138     public RatingsStatsPersistence getRatingsStatsPersistence() {
139         return ratingsStatsPersistence;
140     }
141 
142     public void setRatingsStatsPersistence(
143         RatingsStatsPersistence ratingsStatsPersistence) {
144         this.ratingsStatsPersistence = ratingsStatsPersistence;
145     }
146 
147     public CounterLocalService getCounterLocalService() {
148         return counterLocalService;
149     }
150 
151     public void setCounterLocalService(CounterLocalService counterLocalService) {
152         this.counterLocalService = counterLocalService;
153     }
154 
155     public CounterService getCounterService() {
156         return counterService;
157     }
158 
159     public void setCounterService(CounterService counterService) {
160         this.counterService = counterService;
161     }
162 
163     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryLocalService.impl")
164     protected RatingsEntryLocalService ratingsEntryLocalService;
165     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryService.impl")
166     protected RatingsEntryService ratingsEntryService;
167     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence.impl")
168     protected RatingsEntryPersistence ratingsEntryPersistence;
169     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsStatsLocalService.impl")
170     protected RatingsStatsLocalService ratingsStatsLocalService;
171     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence.impl")
172     protected RatingsStatsPersistence ratingsStatsPersistence;
173     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
174     protected CounterLocalService counterLocalService;
175     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
176     protected CounterService counterService;
177 }