1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  import com.liferay.portal.service.ResourceLocalService;
33  import com.liferay.portal.service.ResourceService;
34  import com.liferay.portal.service.UserLocalService;
35  import com.liferay.portal.service.UserService;
36  import com.liferay.portal.service.persistence.ResourceFinder;
37  import com.liferay.portal.service.persistence.ResourcePersistence;
38  import com.liferay.portal.service.persistence.UserFinder;
39  import com.liferay.portal.service.persistence.UserPersistence;
40  import com.liferay.portal.util.PortalUtil;
41  
42  import com.liferay.portlet.ratings.model.RatingsStats;
43  import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
44  import com.liferay.portlet.ratings.service.RatingsEntryService;
45  import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
46  import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
47  import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
48  
49  import java.util.List;
50  
51  /**
52   * <a href="RatingsStatsLocalServiceBaseImpl.java.html"><b><i>View Source</i>
53   * </b></a>
54   *
55   * @author Brian Wing Shun Chan
56   */
57  public abstract class RatingsStatsLocalServiceBaseImpl
58      implements RatingsStatsLocalService {
59      public RatingsStats addRatingsStats(RatingsStats ratingsStats)
60          throws SystemException {
61          ratingsStats.setNew(true);
62  
63          return ratingsStatsPersistence.update(ratingsStats, false);
64      }
65  
66      public RatingsStats createRatingsStats(long statsId) {
67          return ratingsStatsPersistence.create(statsId);
68      }
69  
70      public void deleteRatingsStats(long statsId)
71          throws PortalException, SystemException {
72          ratingsStatsPersistence.remove(statsId);
73      }
74  
75      public void deleteRatingsStats(RatingsStats ratingsStats)
76          throws SystemException {
77          ratingsStatsPersistence.remove(ratingsStats);
78      }
79  
80      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
81          throws SystemException {
82          return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery);
83      }
84  
85      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
86          int end) throws SystemException {
87          return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery,
88              start, end);
89      }
90  
91      public RatingsStats getRatingsStats(long statsId)
92          throws PortalException, SystemException {
93          return ratingsStatsPersistence.findByPrimaryKey(statsId);
94      }
95  
96      public List<RatingsStats> getRatingsStatses(int start, int end)
97          throws SystemException {
98          return ratingsStatsPersistence.findAll(start, end);
99      }
100 
101     public int getRatingsStatsesCount() throws SystemException {
102         return ratingsStatsPersistence.countAll();
103     }
104 
105     public RatingsStats updateRatingsStats(RatingsStats ratingsStats)
106         throws SystemException {
107         ratingsStats.setNew(false);
108 
109         return ratingsStatsPersistence.update(ratingsStats, true);
110     }
111 
112     public RatingsStats updateRatingsStats(RatingsStats ratingsStats,
113         boolean merge) throws SystemException {
114         ratingsStats.setNew(false);
115 
116         return ratingsStatsPersistence.update(ratingsStats, merge);
117     }
118 
119     public RatingsEntryLocalService getRatingsEntryLocalService() {
120         return ratingsEntryLocalService;
121     }
122 
123     public void setRatingsEntryLocalService(
124         RatingsEntryLocalService ratingsEntryLocalService) {
125         this.ratingsEntryLocalService = ratingsEntryLocalService;
126     }
127 
128     public RatingsEntryService getRatingsEntryService() {
129         return ratingsEntryService;
130     }
131 
132     public void setRatingsEntryService(RatingsEntryService ratingsEntryService) {
133         this.ratingsEntryService = ratingsEntryService;
134     }
135 
136     public RatingsEntryPersistence getRatingsEntryPersistence() {
137         return ratingsEntryPersistence;
138     }
139 
140     public void setRatingsEntryPersistence(
141         RatingsEntryPersistence ratingsEntryPersistence) {
142         this.ratingsEntryPersistence = ratingsEntryPersistence;
143     }
144 
145     public RatingsStatsLocalService getRatingsStatsLocalService() {
146         return ratingsStatsLocalService;
147     }
148 
149     public void setRatingsStatsLocalService(
150         RatingsStatsLocalService ratingsStatsLocalService) {
151         this.ratingsStatsLocalService = ratingsStatsLocalService;
152     }
153 
154     public RatingsStatsPersistence getRatingsStatsPersistence() {
155         return ratingsStatsPersistence;
156     }
157 
158     public void setRatingsStatsPersistence(
159         RatingsStatsPersistence ratingsStatsPersistence) {
160         this.ratingsStatsPersistence = ratingsStatsPersistence;
161     }
162 
163     public CounterLocalService getCounterLocalService() {
164         return counterLocalService;
165     }
166 
167     public void setCounterLocalService(CounterLocalService counterLocalService) {
168         this.counterLocalService = counterLocalService;
169     }
170 
171     public CounterService getCounterService() {
172         return counterService;
173     }
174 
175     public void setCounterService(CounterService counterService) {
176         this.counterService = counterService;
177     }
178 
179     public ResourceLocalService getResourceLocalService() {
180         return resourceLocalService;
181     }
182 
183     public void setResourceLocalService(
184         ResourceLocalService resourceLocalService) {
185         this.resourceLocalService = resourceLocalService;
186     }
187 
188     public ResourceService getResourceService() {
189         return resourceService;
190     }
191 
192     public void setResourceService(ResourceService resourceService) {
193         this.resourceService = resourceService;
194     }
195 
196     public ResourcePersistence getResourcePersistence() {
197         return resourcePersistence;
198     }
199 
200     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
201         this.resourcePersistence = resourcePersistence;
202     }
203 
204     public ResourceFinder getResourceFinder() {
205         return resourceFinder;
206     }
207 
208     public void setResourceFinder(ResourceFinder resourceFinder) {
209         this.resourceFinder = resourceFinder;
210     }
211 
212     public UserLocalService getUserLocalService() {
213         return userLocalService;
214     }
215 
216     public void setUserLocalService(UserLocalService userLocalService) {
217         this.userLocalService = userLocalService;
218     }
219 
220     public UserService getUserService() {
221         return userService;
222     }
223 
224     public void setUserService(UserService userService) {
225         this.userService = userService;
226     }
227 
228     public UserPersistence getUserPersistence() {
229         return userPersistence;
230     }
231 
232     public void setUserPersistence(UserPersistence userPersistence) {
233         this.userPersistence = userPersistence;
234     }
235 
236     public UserFinder getUserFinder() {
237         return userFinder;
238     }
239 
240     public void setUserFinder(UserFinder userFinder) {
241         this.userFinder = userFinder;
242     }
243 
244     protected void runSQL(String sql) throws SystemException {
245         try {
246             PortalUtil.runSQL(sql);
247         }
248         catch (Exception e) {
249             throw new SystemException(e);
250         }
251     }
252 
253     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryLocalService.impl")
254     protected RatingsEntryLocalService ratingsEntryLocalService;
255     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryService.impl")
256     protected RatingsEntryService ratingsEntryService;
257     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence.impl")
258     protected RatingsEntryPersistence ratingsEntryPersistence;
259     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsStatsLocalService.impl")
260     protected RatingsStatsLocalService ratingsStatsLocalService;
261     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence.impl")
262     protected RatingsStatsPersistence ratingsStatsPersistence;
263     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
264     protected CounterLocalService counterLocalService;
265     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
266     protected CounterService counterService;
267     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService.impl")
268     protected ResourceLocalService resourceLocalService;
269     @BeanReference(name = "com.liferay.portal.service.ResourceService.impl")
270     protected ResourceService resourceService;
271     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
272     protected ResourcePersistence resourcePersistence;
273     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder.impl")
274     protected ResourceFinder resourceFinder;
275     @BeanReference(name = "com.liferay.portal.service.UserLocalService.impl")
276     protected UserLocalService userLocalService;
277     @BeanReference(name = "com.liferay.portal.service.UserService.impl")
278     protected UserService userService;
279     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
280     protected UserPersistence userPersistence;
281     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder.impl")
282     protected UserFinder userFinder;
283 }