1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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.kernel.annotation.BeanReference;
21  import com.liferay.portal.kernel.dao.db.DB;
22  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
23  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
24  import com.liferay.portal.kernel.exception.PortalException;
25  import com.liferay.portal.kernel.exception.SystemException;
26  import com.liferay.portal.service.ResourceLocalService;
27  import com.liferay.portal.service.ResourceService;
28  import com.liferay.portal.service.UserLocalService;
29  import com.liferay.portal.service.UserService;
30  import com.liferay.portal.service.persistence.ResourceFinder;
31  import com.liferay.portal.service.persistence.ResourcePersistence;
32  import com.liferay.portal.service.persistence.UserFinder;
33  import com.liferay.portal.service.persistence.UserPersistence;
34  
35  import com.liferay.portlet.blogs.service.BlogsEntryLocalService;
36  import com.liferay.portlet.blogs.service.BlogsEntryService;
37  import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
38  import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
39  import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
40  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
41  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
42  import com.liferay.portlet.ratings.model.RatingsEntry;
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="RatingsEntryLocalServiceBaseImpl.java.html"><b><i>View Source</i>
53   * </b></a>
54   *
55   * @author Brian Wing Shun Chan
56   */
57  public abstract class RatingsEntryLocalServiceBaseImpl
58      implements RatingsEntryLocalService {
59      public RatingsEntry addRatingsEntry(RatingsEntry ratingsEntry)
60          throws SystemException {
61          ratingsEntry.setNew(true);
62  
63          return ratingsEntryPersistence.update(ratingsEntry, false);
64      }
65  
66      public RatingsEntry createRatingsEntry(long entryId) {
67          return ratingsEntryPersistence.create(entryId);
68      }
69  
70      public void deleteRatingsEntry(long entryId)
71          throws PortalException, SystemException {
72          ratingsEntryPersistence.remove(entryId);
73      }
74  
75      public void deleteRatingsEntry(RatingsEntry ratingsEntry)
76          throws SystemException {
77          ratingsEntryPersistence.remove(ratingsEntry);
78      }
79  
80      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
81          throws SystemException {
82          return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery);
83      }
84  
85      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
86          int end) throws SystemException {
87          return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery,
88              start, end);
89      }
90  
91      public RatingsEntry getRatingsEntry(long entryId)
92          throws PortalException, SystemException {
93          return ratingsEntryPersistence.findByPrimaryKey(entryId);
94      }
95  
96      public List<RatingsEntry> getRatingsEntries(int start, int end)
97          throws SystemException {
98          return ratingsEntryPersistence.findAll(start, end);
99      }
100 
101     public int getRatingsEntriesCount() throws SystemException {
102         return ratingsEntryPersistence.countAll();
103     }
104 
105     public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry)
106         throws SystemException {
107         ratingsEntry.setNew(false);
108 
109         return ratingsEntryPersistence.update(ratingsEntry, true);
110     }
111 
112     public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry,
113         boolean merge) throws SystemException {
114         ratingsEntry.setNew(false);
115 
116         return ratingsEntryPersistence.update(ratingsEntry, 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     public BlogsEntryLocalService getBlogsEntryLocalService() {
245         return blogsEntryLocalService;
246     }
247 
248     public void setBlogsEntryLocalService(
249         BlogsEntryLocalService blogsEntryLocalService) {
250         this.blogsEntryLocalService = blogsEntryLocalService;
251     }
252 
253     public BlogsEntryService getBlogsEntryService() {
254         return blogsEntryService;
255     }
256 
257     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
258         this.blogsEntryService = blogsEntryService;
259     }
260 
261     public BlogsEntryPersistence getBlogsEntryPersistence() {
262         return blogsEntryPersistence;
263     }
264 
265     public void setBlogsEntryPersistence(
266         BlogsEntryPersistence blogsEntryPersistence) {
267         this.blogsEntryPersistence = blogsEntryPersistence;
268     }
269 
270     public BlogsEntryFinder getBlogsEntryFinder() {
271         return blogsEntryFinder;
272     }
273 
274     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
275         this.blogsEntryFinder = blogsEntryFinder;
276     }
277 
278     public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
279         return blogsStatsUserLocalService;
280     }
281 
282     public void setBlogsStatsUserLocalService(
283         BlogsStatsUserLocalService blogsStatsUserLocalService) {
284         this.blogsStatsUserLocalService = blogsStatsUserLocalService;
285     }
286 
287     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
288         return blogsStatsUserPersistence;
289     }
290 
291     public void setBlogsStatsUserPersistence(
292         BlogsStatsUserPersistence blogsStatsUserPersistence) {
293         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
294     }
295 
296     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
297         return blogsStatsUserFinder;
298     }
299 
300     public void setBlogsStatsUserFinder(
301         BlogsStatsUserFinder blogsStatsUserFinder) {
302         this.blogsStatsUserFinder = blogsStatsUserFinder;
303     }
304 
305     protected void runSQL(String sql) throws SystemException {
306         try {
307             DB db = DBFactoryUtil.getDB();
308 
309             db.runSQL(sql);
310         }
311         catch (Exception e) {
312             throw new SystemException(e);
313         }
314     }
315 
316     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryLocalService")
317     protected RatingsEntryLocalService ratingsEntryLocalService;
318     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryService")
319     protected RatingsEntryService ratingsEntryService;
320     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence")
321     protected RatingsEntryPersistence ratingsEntryPersistence;
322     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsStatsLocalService")
323     protected RatingsStatsLocalService ratingsStatsLocalService;
324     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence")
325     protected RatingsStatsPersistence ratingsStatsPersistence;
326     @BeanReference(name = "com.liferay.counter.service.CounterLocalService")
327     protected CounterLocalService counterLocalService;
328     @BeanReference(name = "com.liferay.counter.service.CounterService")
329     protected CounterService counterService;
330     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService")
331     protected ResourceLocalService resourceLocalService;
332     @BeanReference(name = "com.liferay.portal.service.ResourceService")
333     protected ResourceService resourceService;
334     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
335     protected ResourcePersistence resourcePersistence;
336     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder")
337     protected ResourceFinder resourceFinder;
338     @BeanReference(name = "com.liferay.portal.service.UserLocalService")
339     protected UserLocalService userLocalService;
340     @BeanReference(name = "com.liferay.portal.service.UserService")
341     protected UserService userService;
342     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
343     protected UserPersistence userPersistence;
344     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder")
345     protected UserFinder userFinder;
346     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsEntryLocalService")
347     protected BlogsEntryLocalService blogsEntryLocalService;
348     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsEntryService")
349     protected BlogsEntryService blogsEntryService;
350     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence")
351     protected BlogsEntryPersistence blogsEntryPersistence;
352     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder")
353     protected BlogsEntryFinder blogsEntryFinder;
354     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsStatsUserLocalService")
355     protected BlogsStatsUserLocalService blogsStatsUserLocalService;
356     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence")
357     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
358     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder")
359     protected BlogsStatsUserFinder blogsStatsUserFinder;
360 }