1   /**
2    * Copyright (c) 2000-2008 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.CounterLocalServiceFactory;
27  import com.liferay.counter.service.CounterService;
28  import com.liferay.counter.service.CounterServiceFactory;
29  
30  import com.liferay.portal.SystemException;
31  import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
32  import com.liferay.portal.service.UserLocalService;
33  import com.liferay.portal.service.UserLocalServiceFactory;
34  import com.liferay.portal.service.UserService;
35  import com.liferay.portal.service.UserServiceFactory;
36  import com.liferay.portal.service.persistence.UserFinder;
37  import com.liferay.portal.service.persistence.UserFinderUtil;
38  import com.liferay.portal.service.persistence.UserPersistence;
39  import com.liferay.portal.service.persistence.UserUtil;
40  
41  import com.liferay.portlet.blogs.service.BlogsEntryLocalService;
42  import com.liferay.portlet.blogs.service.BlogsEntryLocalServiceFactory;
43  import com.liferay.portlet.blogs.service.BlogsEntryService;
44  import com.liferay.portlet.blogs.service.BlogsEntryServiceFactory;
45  import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
46  import com.liferay.portlet.blogs.service.BlogsStatsUserLocalServiceFactory;
47  import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
48  import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinderUtil;
49  import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
50  import com.liferay.portlet.blogs.service.persistence.BlogsEntryUtil;
51  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
52  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinderUtil;
53  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
54  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserUtil;
55  import com.liferay.portlet.ratings.model.RatingsEntry;
56  import com.liferay.portlet.ratings.model.impl.RatingsEntryImpl;
57  import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
58  import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
59  import com.liferay.portlet.ratings.service.RatingsStatsLocalServiceFactory;
60  import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
61  import com.liferay.portlet.ratings.service.persistence.RatingsEntryUtil;
62  import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
63  import com.liferay.portlet.ratings.service.persistence.RatingsStatsUtil;
64  
65  import org.springframework.beans.factory.InitializingBean;
66  
67  import java.util.List;
68  
69  /**
70   * <a href="RatingsEntryLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
71   *
72   * @author Brian Wing Shun Chan
73   *
74   */
75  public abstract class RatingsEntryLocalServiceBaseImpl
76      implements RatingsEntryLocalService, InitializingBean {
77      public RatingsEntry addRatingsEntry(RatingsEntry model)
78          throws SystemException {
79          RatingsEntry ratingsEntry = new RatingsEntryImpl();
80  
81          ratingsEntry.setNew(true);
82  
83          ratingsEntry.setEntryId(model.getEntryId());
84          ratingsEntry.setCompanyId(model.getCompanyId());
85          ratingsEntry.setUserId(model.getUserId());
86          ratingsEntry.setUserName(model.getUserName());
87          ratingsEntry.setCreateDate(model.getCreateDate());
88          ratingsEntry.setModifiedDate(model.getModifiedDate());
89          ratingsEntry.setClassNameId(model.getClassNameId());
90          ratingsEntry.setClassPK(model.getClassPK());
91          ratingsEntry.setScore(model.getScore());
92  
93          return ratingsEntryPersistence.update(ratingsEntry);
94      }
95  
96      public List dynamicQuery(DynamicQueryInitializer queryInitializer)
97          throws SystemException {
98          return ratingsEntryPersistence.findWithDynamicQuery(queryInitializer);
99      }
100 
101     public List dynamicQuery(DynamicQueryInitializer queryInitializer,
102         int begin, int end) throws SystemException {
103         return ratingsEntryPersistence.findWithDynamicQuery(queryInitializer,
104             begin, end);
105     }
106 
107     public RatingsEntry updateRatingsEntry(RatingsEntry model)
108         throws SystemException {
109         return ratingsEntryPersistence.update(model, true);
110     }
111 
112     public RatingsEntryPersistence getRatingsEntryPersistence() {
113         return ratingsEntryPersistence;
114     }
115 
116     public void setRatingsEntryPersistence(
117         RatingsEntryPersistence ratingsEntryPersistence) {
118         this.ratingsEntryPersistence = ratingsEntryPersistence;
119     }
120 
121     public RatingsStatsLocalService getRatingsStatsLocalService() {
122         return ratingsStatsLocalService;
123     }
124 
125     public void setRatingsStatsLocalService(
126         RatingsStatsLocalService ratingsStatsLocalService) {
127         this.ratingsStatsLocalService = ratingsStatsLocalService;
128     }
129 
130     public RatingsStatsPersistence getRatingsStatsPersistence() {
131         return ratingsStatsPersistence;
132     }
133 
134     public void setRatingsStatsPersistence(
135         RatingsStatsPersistence ratingsStatsPersistence) {
136         this.ratingsStatsPersistence = ratingsStatsPersistence;
137     }
138 
139     public CounterLocalService getCounterLocalService() {
140         return counterLocalService;
141     }
142 
143     public void setCounterLocalService(CounterLocalService counterLocalService) {
144         this.counterLocalService = counterLocalService;
145     }
146 
147     public CounterService getCounterService() {
148         return counterService;
149     }
150 
151     public void setCounterService(CounterService counterService) {
152         this.counterService = counterService;
153     }
154 
155     public UserLocalService getUserLocalService() {
156         return userLocalService;
157     }
158 
159     public void setUserLocalService(UserLocalService userLocalService) {
160         this.userLocalService = userLocalService;
161     }
162 
163     public UserService getUserService() {
164         return userService;
165     }
166 
167     public void setUserService(UserService userService) {
168         this.userService = userService;
169     }
170 
171     public UserPersistence getUserPersistence() {
172         return userPersistence;
173     }
174 
175     public void setUserPersistence(UserPersistence userPersistence) {
176         this.userPersistence = userPersistence;
177     }
178 
179     public UserFinder getUserFinder() {
180         return userFinder;
181     }
182 
183     public void setUserFinder(UserFinder userFinder) {
184         this.userFinder = userFinder;
185     }
186 
187     public BlogsEntryLocalService getBlogsEntryLocalService() {
188         return blogsEntryLocalService;
189     }
190 
191     public void setBlogsEntryLocalService(
192         BlogsEntryLocalService blogsEntryLocalService) {
193         this.blogsEntryLocalService = blogsEntryLocalService;
194     }
195 
196     public BlogsEntryService getBlogsEntryService() {
197         return blogsEntryService;
198     }
199 
200     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
201         this.blogsEntryService = blogsEntryService;
202     }
203 
204     public BlogsEntryPersistence getBlogsEntryPersistence() {
205         return blogsEntryPersistence;
206     }
207 
208     public void setBlogsEntryPersistence(
209         BlogsEntryPersistence blogsEntryPersistence) {
210         this.blogsEntryPersistence = blogsEntryPersistence;
211     }
212 
213     public BlogsEntryFinder getBlogsEntryFinder() {
214         return blogsEntryFinder;
215     }
216 
217     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
218         this.blogsEntryFinder = blogsEntryFinder;
219     }
220 
221     public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
222         return blogsStatsUserLocalService;
223     }
224 
225     public void setBlogsStatsUserLocalService(
226         BlogsStatsUserLocalService blogsStatsUserLocalService) {
227         this.blogsStatsUserLocalService = blogsStatsUserLocalService;
228     }
229 
230     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
231         return blogsStatsUserPersistence;
232     }
233 
234     public void setBlogsStatsUserPersistence(
235         BlogsStatsUserPersistence blogsStatsUserPersistence) {
236         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
237     }
238 
239     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
240         return blogsStatsUserFinder;
241     }
242 
243     public void setBlogsStatsUserFinder(
244         BlogsStatsUserFinder blogsStatsUserFinder) {
245         this.blogsStatsUserFinder = blogsStatsUserFinder;
246     }
247 
248     public void afterPropertiesSet() {
249         if (ratingsEntryPersistence == null) {
250             ratingsEntryPersistence = RatingsEntryUtil.getPersistence();
251         }
252 
253         if (ratingsStatsLocalService == null) {
254             ratingsStatsLocalService = RatingsStatsLocalServiceFactory.getImpl();
255         }
256 
257         if (ratingsStatsPersistence == null) {
258             ratingsStatsPersistence = RatingsStatsUtil.getPersistence();
259         }
260 
261         if (counterLocalService == null) {
262             counterLocalService = CounterLocalServiceFactory.getImpl();
263         }
264 
265         if (counterService == null) {
266             counterService = CounterServiceFactory.getImpl();
267         }
268 
269         if (userLocalService == null) {
270             userLocalService = UserLocalServiceFactory.getImpl();
271         }
272 
273         if (userService == null) {
274             userService = UserServiceFactory.getImpl();
275         }
276 
277         if (userPersistence == null) {
278             userPersistence = UserUtil.getPersistence();
279         }
280 
281         if (userFinder == null) {
282             userFinder = UserFinderUtil.getFinder();
283         }
284 
285         if (blogsEntryLocalService == null) {
286             blogsEntryLocalService = BlogsEntryLocalServiceFactory.getImpl();
287         }
288 
289         if (blogsEntryService == null) {
290             blogsEntryService = BlogsEntryServiceFactory.getImpl();
291         }
292 
293         if (blogsEntryPersistence == null) {
294             blogsEntryPersistence = BlogsEntryUtil.getPersistence();
295         }
296 
297         if (blogsEntryFinder == null) {
298             blogsEntryFinder = BlogsEntryFinderUtil.getFinder();
299         }
300 
301         if (blogsStatsUserLocalService == null) {
302             blogsStatsUserLocalService = BlogsStatsUserLocalServiceFactory.getImpl();
303         }
304 
305         if (blogsStatsUserPersistence == null) {
306             blogsStatsUserPersistence = BlogsStatsUserUtil.getPersistence();
307         }
308 
309         if (blogsStatsUserFinder == null) {
310             blogsStatsUserFinder = BlogsStatsUserFinderUtil.getFinder();
311         }
312     }
313 
314     protected RatingsEntryPersistence ratingsEntryPersistence;
315     protected RatingsStatsLocalService ratingsStatsLocalService;
316     protected RatingsStatsPersistence ratingsStatsPersistence;
317     protected CounterLocalService counterLocalService;
318     protected CounterService counterService;
319     protected UserLocalService userLocalService;
320     protected UserService userService;
321     protected UserPersistence userPersistence;
322     protected UserFinder userFinder;
323     protected BlogsEntryLocalService blogsEntryLocalService;
324     protected BlogsEntryService blogsEntryService;
325     protected BlogsEntryPersistence blogsEntryPersistence;
326     protected BlogsEntryFinder blogsEntryFinder;
327     protected BlogsStatsUserLocalService blogsStatsUserLocalService;
328     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
329     protected BlogsStatsUserFinder blogsStatsUserFinder;
330 }