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.db.DB;
32  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
33  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
34  import com.liferay.portal.service.ResourceLocalService;
35  import com.liferay.portal.service.ResourceService;
36  import com.liferay.portal.service.UserLocalService;
37  import com.liferay.portal.service.UserService;
38  import com.liferay.portal.service.persistence.ResourceFinder;
39  import com.liferay.portal.service.persistence.ResourcePersistence;
40  import com.liferay.portal.service.persistence.UserFinder;
41  import com.liferay.portal.service.persistence.UserPersistence;
42  
43  import com.liferay.portlet.blogs.service.BlogsEntryLocalService;
44  import com.liferay.portlet.blogs.service.BlogsEntryService;
45  import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
46  import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
47  import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
48  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
49  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
50  import com.liferay.portlet.ratings.model.RatingsEntry;
51  import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
52  import com.liferay.portlet.ratings.service.RatingsEntryService;
53  import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
54  import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
55  import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
56  
57  import java.util.List;
58  
59  /**
60   * <a href="RatingsEntryLocalServiceBaseImpl.java.html"><b><i>View Source</i>
61   * </b></a>
62   *
63   * @author Brian Wing Shun Chan
64   */
65  public abstract class RatingsEntryLocalServiceBaseImpl
66      implements RatingsEntryLocalService {
67      public RatingsEntry addRatingsEntry(RatingsEntry ratingsEntry)
68          throws SystemException {
69          ratingsEntry.setNew(true);
70  
71          return ratingsEntryPersistence.update(ratingsEntry, false);
72      }
73  
74      public RatingsEntry createRatingsEntry(long entryId) {
75          return ratingsEntryPersistence.create(entryId);
76      }
77  
78      public void deleteRatingsEntry(long entryId)
79          throws PortalException, SystemException {
80          ratingsEntryPersistence.remove(entryId);
81      }
82  
83      public void deleteRatingsEntry(RatingsEntry ratingsEntry)
84          throws SystemException {
85          ratingsEntryPersistence.remove(ratingsEntry);
86      }
87  
88      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
89          throws SystemException {
90          return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery);
91      }
92  
93      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
94          int end) throws SystemException {
95          return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery,
96              start, end);
97      }
98  
99      public RatingsEntry getRatingsEntry(long entryId)
100         throws PortalException, SystemException {
101         return ratingsEntryPersistence.findByPrimaryKey(entryId);
102     }
103 
104     public List<RatingsEntry> getRatingsEntries(int start, int end)
105         throws SystemException {
106         return ratingsEntryPersistence.findAll(start, end);
107     }
108 
109     public int getRatingsEntriesCount() throws SystemException {
110         return ratingsEntryPersistence.countAll();
111     }
112 
113     public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry)
114         throws SystemException {
115         ratingsEntry.setNew(false);
116 
117         return ratingsEntryPersistence.update(ratingsEntry, true);
118     }
119 
120     public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry,
121         boolean merge) throws SystemException {
122         ratingsEntry.setNew(false);
123 
124         return ratingsEntryPersistence.update(ratingsEntry, merge);
125     }
126 
127     public RatingsEntryLocalService getRatingsEntryLocalService() {
128         return ratingsEntryLocalService;
129     }
130 
131     public void setRatingsEntryLocalService(
132         RatingsEntryLocalService ratingsEntryLocalService) {
133         this.ratingsEntryLocalService = ratingsEntryLocalService;
134     }
135 
136     public RatingsEntryService getRatingsEntryService() {
137         return ratingsEntryService;
138     }
139 
140     public void setRatingsEntryService(RatingsEntryService ratingsEntryService) {
141         this.ratingsEntryService = ratingsEntryService;
142     }
143 
144     public RatingsEntryPersistence getRatingsEntryPersistence() {
145         return ratingsEntryPersistence;
146     }
147 
148     public void setRatingsEntryPersistence(
149         RatingsEntryPersistence ratingsEntryPersistence) {
150         this.ratingsEntryPersistence = ratingsEntryPersistence;
151     }
152 
153     public RatingsStatsLocalService getRatingsStatsLocalService() {
154         return ratingsStatsLocalService;
155     }
156 
157     public void setRatingsStatsLocalService(
158         RatingsStatsLocalService ratingsStatsLocalService) {
159         this.ratingsStatsLocalService = ratingsStatsLocalService;
160     }
161 
162     public RatingsStatsPersistence getRatingsStatsPersistence() {
163         return ratingsStatsPersistence;
164     }
165 
166     public void setRatingsStatsPersistence(
167         RatingsStatsPersistence ratingsStatsPersistence) {
168         this.ratingsStatsPersistence = ratingsStatsPersistence;
169     }
170 
171     public CounterLocalService getCounterLocalService() {
172         return counterLocalService;
173     }
174 
175     public void setCounterLocalService(CounterLocalService counterLocalService) {
176         this.counterLocalService = counterLocalService;
177     }
178 
179     public CounterService getCounterService() {
180         return counterService;
181     }
182 
183     public void setCounterService(CounterService counterService) {
184         this.counterService = counterService;
185     }
186 
187     public ResourceLocalService getResourceLocalService() {
188         return resourceLocalService;
189     }
190 
191     public void setResourceLocalService(
192         ResourceLocalService resourceLocalService) {
193         this.resourceLocalService = resourceLocalService;
194     }
195 
196     public ResourceService getResourceService() {
197         return resourceService;
198     }
199 
200     public void setResourceService(ResourceService resourceService) {
201         this.resourceService = resourceService;
202     }
203 
204     public ResourcePersistence getResourcePersistence() {
205         return resourcePersistence;
206     }
207 
208     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
209         this.resourcePersistence = resourcePersistence;
210     }
211 
212     public ResourceFinder getResourceFinder() {
213         return resourceFinder;
214     }
215 
216     public void setResourceFinder(ResourceFinder resourceFinder) {
217         this.resourceFinder = resourceFinder;
218     }
219 
220     public UserLocalService getUserLocalService() {
221         return userLocalService;
222     }
223 
224     public void setUserLocalService(UserLocalService userLocalService) {
225         this.userLocalService = userLocalService;
226     }
227 
228     public UserService getUserService() {
229         return userService;
230     }
231 
232     public void setUserService(UserService userService) {
233         this.userService = userService;
234     }
235 
236     public UserPersistence getUserPersistence() {
237         return userPersistence;
238     }
239 
240     public void setUserPersistence(UserPersistence userPersistence) {
241         this.userPersistence = userPersistence;
242     }
243 
244     public UserFinder getUserFinder() {
245         return userFinder;
246     }
247 
248     public void setUserFinder(UserFinder userFinder) {
249         this.userFinder = userFinder;
250     }
251 
252     public BlogsEntryLocalService getBlogsEntryLocalService() {
253         return blogsEntryLocalService;
254     }
255 
256     public void setBlogsEntryLocalService(
257         BlogsEntryLocalService blogsEntryLocalService) {
258         this.blogsEntryLocalService = blogsEntryLocalService;
259     }
260 
261     public BlogsEntryService getBlogsEntryService() {
262         return blogsEntryService;
263     }
264 
265     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
266         this.blogsEntryService = blogsEntryService;
267     }
268 
269     public BlogsEntryPersistence getBlogsEntryPersistence() {
270         return blogsEntryPersistence;
271     }
272 
273     public void setBlogsEntryPersistence(
274         BlogsEntryPersistence blogsEntryPersistence) {
275         this.blogsEntryPersistence = blogsEntryPersistence;
276     }
277 
278     public BlogsEntryFinder getBlogsEntryFinder() {
279         return blogsEntryFinder;
280     }
281 
282     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
283         this.blogsEntryFinder = blogsEntryFinder;
284     }
285 
286     public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
287         return blogsStatsUserLocalService;
288     }
289 
290     public void setBlogsStatsUserLocalService(
291         BlogsStatsUserLocalService blogsStatsUserLocalService) {
292         this.blogsStatsUserLocalService = blogsStatsUserLocalService;
293     }
294 
295     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
296         return blogsStatsUserPersistence;
297     }
298 
299     public void setBlogsStatsUserPersistence(
300         BlogsStatsUserPersistence blogsStatsUserPersistence) {
301         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
302     }
303 
304     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
305         return blogsStatsUserFinder;
306     }
307 
308     public void setBlogsStatsUserFinder(
309         BlogsStatsUserFinder blogsStatsUserFinder) {
310         this.blogsStatsUserFinder = blogsStatsUserFinder;
311     }
312 
313     protected void runSQL(String sql) throws SystemException {
314         try {
315             DB db = DBFactoryUtil.getDB();
316 
317             db.runSQL(sql);
318         }
319         catch (Exception e) {
320             throw new SystemException(e);
321         }
322     }
323 
324     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryLocalService.impl")
325     protected RatingsEntryLocalService ratingsEntryLocalService;
326     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryService.impl")
327     protected RatingsEntryService ratingsEntryService;
328     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence.impl")
329     protected RatingsEntryPersistence ratingsEntryPersistence;
330     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsStatsLocalService.impl")
331     protected RatingsStatsLocalService ratingsStatsLocalService;
332     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence.impl")
333     protected RatingsStatsPersistence ratingsStatsPersistence;
334     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
335     protected CounterLocalService counterLocalService;
336     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
337     protected CounterService counterService;
338     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService.impl")
339     protected ResourceLocalService resourceLocalService;
340     @BeanReference(name = "com.liferay.portal.service.ResourceService.impl")
341     protected ResourceService resourceService;
342     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
343     protected ResourcePersistence resourcePersistence;
344     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder.impl")
345     protected ResourceFinder resourceFinder;
346     @BeanReference(name = "com.liferay.portal.service.UserLocalService.impl")
347     protected UserLocalService userLocalService;
348     @BeanReference(name = "com.liferay.portal.service.UserService.impl")
349     protected UserService userService;
350     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
351     protected UserPersistence userPersistence;
352     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder.impl")
353     protected UserFinder userFinder;
354     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsEntryLocalService.impl")
355     protected BlogsEntryLocalService blogsEntryLocalService;
356     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsEntryService.impl")
357     protected BlogsEntryService blogsEntryService;
358     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence.impl")
359     protected BlogsEntryPersistence blogsEntryPersistence;
360     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder.impl")
361     protected BlogsEntryFinder blogsEntryFinder;
362     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsStatsUserLocalService.impl")
363     protected BlogsStatsUserLocalService blogsStatsUserLocalService;
364     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence.impl")
365     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
366     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder.impl")
367     protected BlogsStatsUserFinder blogsStatsUserFinder;
368 }