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