001
014
015 package com.liferay.portlet.ratings.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.annotation.BeanReference;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023 import com.liferay.portal.kernel.exception.PortalException;
024 import com.liferay.portal.kernel.exception.SystemException;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026 import com.liferay.portal.service.ResourceLocalService;
027 import com.liferay.portal.service.ResourceService;
028 import com.liferay.portal.service.UserLocalService;
029 import com.liferay.portal.service.UserService;
030 import com.liferay.portal.service.persistence.ResourceFinder;
031 import com.liferay.portal.service.persistence.ResourcePersistence;
032 import com.liferay.portal.service.persistence.UserFinder;
033 import com.liferay.portal.service.persistence.UserPersistence;
034
035 import com.liferay.portlet.ratings.model.RatingsStats;
036 import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
037 import com.liferay.portlet.ratings.service.RatingsEntryService;
038 import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
039 import com.liferay.portlet.ratings.service.persistence.RatingsEntryFinder;
040 import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
041 import com.liferay.portlet.ratings.service.persistence.RatingsStatsFinder;
042 import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
043
044 import java.util.List;
045
046 import javax.sql.DataSource;
047
048
064 public abstract class RatingsStatsLocalServiceBaseImpl
065 implements RatingsStatsLocalService {
066
073 public RatingsStats addRatingsStats(RatingsStats ratingsStats)
074 throws SystemException {
075 ratingsStats.setNew(true);
076
077 return ratingsStatsPersistence.update(ratingsStats, false);
078 }
079
080
086 public RatingsStats createRatingsStats(long statsId) {
087 return ratingsStatsPersistence.create(statsId);
088 }
089
090
097 public void deleteRatingsStats(long statsId)
098 throws PortalException, SystemException {
099 ratingsStatsPersistence.remove(statsId);
100 }
101
102
108 public void deleteRatingsStats(RatingsStats ratingsStats)
109 throws SystemException {
110 ratingsStatsPersistence.remove(ratingsStats);
111 }
112
113
120 @SuppressWarnings("rawtypes")
121 public List dynamicQuery(DynamicQuery dynamicQuery)
122 throws SystemException {
123 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery);
124 }
125
126
139 @SuppressWarnings("rawtypes")
140 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
141 throws SystemException {
142 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery,
143 start, end);
144 }
145
146
160 @SuppressWarnings("rawtypes")
161 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
162 OrderByComparator orderByComparator) throws SystemException {
163 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery,
164 start, end, orderByComparator);
165 }
166
167
174 public long dynamicQueryCount(DynamicQuery dynamicQuery)
175 throws SystemException {
176 return ratingsStatsPersistence.countWithDynamicQuery(dynamicQuery);
177 }
178
179
187 public RatingsStats getRatingsStats(long statsId)
188 throws PortalException, SystemException {
189 return ratingsStatsPersistence.findByPrimaryKey(statsId);
190 }
191
192
204 public List<RatingsStats> getRatingsStatses(int start, int end)
205 throws SystemException {
206 return ratingsStatsPersistence.findAll(start, end);
207 }
208
209
215 public int getRatingsStatsesCount() throws SystemException {
216 return ratingsStatsPersistence.countAll();
217 }
218
219
226 public RatingsStats updateRatingsStats(RatingsStats ratingsStats)
227 throws SystemException {
228 ratingsStats.setNew(false);
229
230 return ratingsStatsPersistence.update(ratingsStats, true);
231 }
232
233
241 public RatingsStats updateRatingsStats(RatingsStats ratingsStats,
242 boolean merge) throws SystemException {
243 ratingsStats.setNew(false);
244
245 return ratingsStatsPersistence.update(ratingsStats, merge);
246 }
247
248
253 public RatingsEntryLocalService getRatingsEntryLocalService() {
254 return ratingsEntryLocalService;
255 }
256
257
262 public void setRatingsEntryLocalService(
263 RatingsEntryLocalService ratingsEntryLocalService) {
264 this.ratingsEntryLocalService = ratingsEntryLocalService;
265 }
266
267
272 public RatingsEntryService getRatingsEntryService() {
273 return ratingsEntryService;
274 }
275
276
281 public void setRatingsEntryService(RatingsEntryService ratingsEntryService) {
282 this.ratingsEntryService = ratingsEntryService;
283 }
284
285
290 public RatingsEntryPersistence getRatingsEntryPersistence() {
291 return ratingsEntryPersistence;
292 }
293
294
299 public void setRatingsEntryPersistence(
300 RatingsEntryPersistence ratingsEntryPersistence) {
301 this.ratingsEntryPersistence = ratingsEntryPersistence;
302 }
303
304
309 public RatingsEntryFinder getRatingsEntryFinder() {
310 return ratingsEntryFinder;
311 }
312
313
318 public void setRatingsEntryFinder(RatingsEntryFinder ratingsEntryFinder) {
319 this.ratingsEntryFinder = ratingsEntryFinder;
320 }
321
322
327 public RatingsStatsLocalService getRatingsStatsLocalService() {
328 return ratingsStatsLocalService;
329 }
330
331
336 public void setRatingsStatsLocalService(
337 RatingsStatsLocalService ratingsStatsLocalService) {
338 this.ratingsStatsLocalService = ratingsStatsLocalService;
339 }
340
341
346 public RatingsStatsPersistence getRatingsStatsPersistence() {
347 return ratingsStatsPersistence;
348 }
349
350
355 public void setRatingsStatsPersistence(
356 RatingsStatsPersistence ratingsStatsPersistence) {
357 this.ratingsStatsPersistence = ratingsStatsPersistence;
358 }
359
360
365 public RatingsStatsFinder getRatingsStatsFinder() {
366 return ratingsStatsFinder;
367 }
368
369
374 public void setRatingsStatsFinder(RatingsStatsFinder ratingsStatsFinder) {
375 this.ratingsStatsFinder = ratingsStatsFinder;
376 }
377
378
383 public CounterLocalService getCounterLocalService() {
384 return counterLocalService;
385 }
386
387
392 public void setCounterLocalService(CounterLocalService counterLocalService) {
393 this.counterLocalService = counterLocalService;
394 }
395
396
401 public ResourceLocalService getResourceLocalService() {
402 return resourceLocalService;
403 }
404
405
410 public void setResourceLocalService(
411 ResourceLocalService resourceLocalService) {
412 this.resourceLocalService = resourceLocalService;
413 }
414
415
420 public ResourceService getResourceService() {
421 return resourceService;
422 }
423
424
429 public void setResourceService(ResourceService resourceService) {
430 this.resourceService = resourceService;
431 }
432
433
438 public ResourcePersistence getResourcePersistence() {
439 return resourcePersistence;
440 }
441
442
447 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
448 this.resourcePersistence = resourcePersistence;
449 }
450
451
456 public ResourceFinder getResourceFinder() {
457 return resourceFinder;
458 }
459
460
465 public void setResourceFinder(ResourceFinder resourceFinder) {
466 this.resourceFinder = resourceFinder;
467 }
468
469
474 public UserLocalService getUserLocalService() {
475 return userLocalService;
476 }
477
478
483 public void setUserLocalService(UserLocalService userLocalService) {
484 this.userLocalService = userLocalService;
485 }
486
487
492 public UserService getUserService() {
493 return userService;
494 }
495
496
501 public void setUserService(UserService userService) {
502 this.userService = userService;
503 }
504
505
510 public UserPersistence getUserPersistence() {
511 return userPersistence;
512 }
513
514
519 public void setUserPersistence(UserPersistence userPersistence) {
520 this.userPersistence = userPersistence;
521 }
522
523
528 public UserFinder getUserFinder() {
529 return userFinder;
530 }
531
532
537 public void setUserFinder(UserFinder userFinder) {
538 this.userFinder = userFinder;
539 }
540
541
546 protected void runSQL(String sql) throws SystemException {
547 try {
548 DataSource dataSource = ratingsStatsPersistence.getDataSource();
549
550 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
551 sql, new int[0]);
552
553 sqlUpdate.update();
554 }
555 catch (Exception e) {
556 throw new SystemException(e);
557 }
558 }
559
560 @BeanReference(type = RatingsEntryLocalService.class)
561 protected RatingsEntryLocalService ratingsEntryLocalService;
562 @BeanReference(type = RatingsEntryService.class)
563 protected RatingsEntryService ratingsEntryService;
564 @BeanReference(type = RatingsEntryPersistence.class)
565 protected RatingsEntryPersistence ratingsEntryPersistence;
566 @BeanReference(type = RatingsEntryFinder.class)
567 protected RatingsEntryFinder ratingsEntryFinder;
568 @BeanReference(type = RatingsStatsLocalService.class)
569 protected RatingsStatsLocalService ratingsStatsLocalService;
570 @BeanReference(type = RatingsStatsPersistence.class)
571 protected RatingsStatsPersistence ratingsStatsPersistence;
572 @BeanReference(type = RatingsStatsFinder.class)
573 protected RatingsStatsFinder ratingsStatsFinder;
574 @BeanReference(type = CounterLocalService.class)
575 protected CounterLocalService counterLocalService;
576 @BeanReference(type = ResourceLocalService.class)
577 protected ResourceLocalService resourceLocalService;
578 @BeanReference(type = ResourceService.class)
579 protected ResourceService resourceService;
580 @BeanReference(type = ResourcePersistence.class)
581 protected ResourcePersistence resourcePersistence;
582 @BeanReference(type = ResourceFinder.class)
583 protected ResourceFinder resourceFinder;
584 @BeanReference(type = UserLocalService.class)
585 protected UserLocalService userLocalService;
586 @BeanReference(type = UserService.class)
587 protected UserService userService;
588 @BeanReference(type = UserPersistence.class)
589 protected UserPersistence userPersistence;
590 @BeanReference(type = UserFinder.class)
591 protected UserFinder userFinder;
592 }