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