1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.ratings.service.base;
21  
22  import com.liferay.counter.service.CounterLocalService;
23  import com.liferay.counter.service.CounterService;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.UserService;
31  import com.liferay.portal.service.persistence.UserFinder;
32  import com.liferay.portal.service.persistence.UserPersistence;
33  import com.liferay.portal.util.PortalUtil;
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></b></a>
53   *
54   * @author Brian Wing Shun Chan
55   *
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 UserLocalService getUserLocalService() {
180         return userLocalService;
181     }
182 
183     public void setUserLocalService(UserLocalService userLocalService) {
184         this.userLocalService = userLocalService;
185     }
186 
187     public UserService getUserService() {
188         return userService;
189     }
190 
191     public void setUserService(UserService userService) {
192         this.userService = userService;
193     }
194 
195     public UserPersistence getUserPersistence() {
196         return userPersistence;
197     }
198 
199     public void setUserPersistence(UserPersistence userPersistence) {
200         this.userPersistence = userPersistence;
201     }
202 
203     public UserFinder getUserFinder() {
204         return userFinder;
205     }
206 
207     public void setUserFinder(UserFinder userFinder) {
208         this.userFinder = userFinder;
209     }
210 
211     public BlogsEntryLocalService getBlogsEntryLocalService() {
212         return blogsEntryLocalService;
213     }
214 
215     public void setBlogsEntryLocalService(
216         BlogsEntryLocalService blogsEntryLocalService) {
217         this.blogsEntryLocalService = blogsEntryLocalService;
218     }
219 
220     public BlogsEntryService getBlogsEntryService() {
221         return blogsEntryService;
222     }
223 
224     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
225         this.blogsEntryService = blogsEntryService;
226     }
227 
228     public BlogsEntryPersistence getBlogsEntryPersistence() {
229         return blogsEntryPersistence;
230     }
231 
232     public void setBlogsEntryPersistence(
233         BlogsEntryPersistence blogsEntryPersistence) {
234         this.blogsEntryPersistence = blogsEntryPersistence;
235     }
236 
237     public BlogsEntryFinder getBlogsEntryFinder() {
238         return blogsEntryFinder;
239     }
240 
241     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
242         this.blogsEntryFinder = blogsEntryFinder;
243     }
244 
245     public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
246         return blogsStatsUserLocalService;
247     }
248 
249     public void setBlogsStatsUserLocalService(
250         BlogsStatsUserLocalService blogsStatsUserLocalService) {
251         this.blogsStatsUserLocalService = blogsStatsUserLocalService;
252     }
253 
254     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
255         return blogsStatsUserPersistence;
256     }
257 
258     public void setBlogsStatsUserPersistence(
259         BlogsStatsUserPersistence blogsStatsUserPersistence) {
260         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
261     }
262 
263     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
264         return blogsStatsUserFinder;
265     }
266 
267     public void setBlogsStatsUserFinder(
268         BlogsStatsUserFinder blogsStatsUserFinder) {
269         this.blogsStatsUserFinder = blogsStatsUserFinder;
270     }
271 
272     protected void runSQL(String sql) throws SystemException {
273         try {
274             PortalUtil.runSQL(sql);
275         }
276         catch (Exception e) {
277             throw new SystemException(e);
278         }
279     }
280 
281     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryLocalService.impl")
282     protected RatingsEntryLocalService ratingsEntryLocalService;
283     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryService.impl")
284     protected RatingsEntryService ratingsEntryService;
285     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence.impl")
286     protected RatingsEntryPersistence ratingsEntryPersistence;
287     @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsStatsLocalService.impl")
288     protected RatingsStatsLocalService ratingsStatsLocalService;
289     @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence.impl")
290     protected RatingsStatsPersistence ratingsStatsPersistence;
291     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
292     protected CounterLocalService counterLocalService;
293     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
294     protected CounterService counterService;
295     @BeanReference(name = "com.liferay.portal.service.UserLocalService.impl")
296     protected UserLocalService userLocalService;
297     @BeanReference(name = "com.liferay.portal.service.UserService.impl")
298     protected UserService userService;
299     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
300     protected UserPersistence userPersistence;
301     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder.impl")
302     protected UserFinder userFinder;
303     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsEntryLocalService.impl")
304     protected BlogsEntryLocalService blogsEntryLocalService;
305     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsEntryService.impl")
306     protected BlogsEntryService blogsEntryService;
307     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence.impl")
308     protected BlogsEntryPersistence blogsEntryPersistence;
309     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder.impl")
310     protected BlogsEntryFinder blogsEntryFinder;
311     @BeanReference(name = "com.liferay.portlet.blogs.service.BlogsStatsUserLocalService.impl")
312     protected BlogsStatsUserLocalService blogsStatsUserLocalService;
313     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence.impl")
314     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
315     @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder.impl")
316     protected BlogsStatsUserFinder blogsStatsUserFinder;
317 }