001
014
015 package com.liferay.portlet.ratings.service.base;
016
017 import com.liferay.portal.kernel.bean.BeanReference;
018 import com.liferay.portal.kernel.bean.IdentifiableBean;
019 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
021 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.Projection;
024 import com.liferay.portal.kernel.exception.PortalException;
025 import com.liferay.portal.kernel.exception.SystemException;
026 import com.liferay.portal.kernel.search.Indexable;
027 import com.liferay.portal.kernel.search.IndexableType;
028 import com.liferay.portal.kernel.util.OrderByComparator;
029 import com.liferay.portal.model.PersistedModel;
030 import com.liferay.portal.service.BaseLocalServiceImpl;
031 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
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.RatingsStatsLocalService;
037 import com.liferay.portlet.ratings.service.persistence.RatingsEntryFinder;
038 import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
039 import com.liferay.portlet.ratings.service.persistence.RatingsStatsFinder;
040 import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
041
042 import java.io.Serializable;
043
044 import java.util.List;
045
046 import javax.sql.DataSource;
047
048
060 public abstract class RatingsStatsLocalServiceBaseImpl
061 extends BaseLocalServiceImpl implements RatingsStatsLocalService,
062 IdentifiableBean {
063
068
069
076 @Indexable(type = IndexableType.REINDEX)
077 @Override
078 public RatingsStats addRatingsStats(RatingsStats ratingsStats)
079 throws SystemException {
080 ratingsStats.setNew(true);
081
082 return ratingsStatsPersistence.update(ratingsStats);
083 }
084
085
091 @Override
092 public RatingsStats createRatingsStats(long statsId) {
093 return ratingsStatsPersistence.create(statsId);
094 }
095
096
104 @Indexable(type = IndexableType.DELETE)
105 @Override
106 public RatingsStats deleteRatingsStats(long statsId)
107 throws PortalException, SystemException {
108 return ratingsStatsPersistence.remove(statsId);
109 }
110
111
118 @Indexable(type = IndexableType.DELETE)
119 @Override
120 public RatingsStats deleteRatingsStats(RatingsStats ratingsStats)
121 throws SystemException {
122 return ratingsStatsPersistence.remove(ratingsStats);
123 }
124
125 @Override
126 public DynamicQuery dynamicQuery() {
127 Class<?> clazz = getClass();
128
129 return DynamicQueryFactoryUtil.forClass(RatingsStats.class,
130 clazz.getClassLoader());
131 }
132
133
140 @Override
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery)
143 throws SystemException {
144 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery);
145 }
146
147
160 @Override
161 @SuppressWarnings("rawtypes")
162 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
163 throws SystemException {
164 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery,
165 start, end);
166 }
167
168
182 @Override
183 @SuppressWarnings("rawtypes")
184 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
185 OrderByComparator orderByComparator) throws SystemException {
186 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery,
187 start, end, orderByComparator);
188 }
189
190
197 @Override
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return ratingsStatsPersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203
211 @Override
212 public long dynamicQueryCount(DynamicQuery dynamicQuery,
213 Projection projection) throws SystemException {
214 return ratingsStatsPersistence.countWithDynamicQuery(dynamicQuery,
215 projection);
216 }
217
218 @Override
219 public RatingsStats fetchRatingsStats(long statsId)
220 throws SystemException {
221 return ratingsStatsPersistence.fetchByPrimaryKey(statsId);
222 }
223
224
232 @Override
233 public RatingsStats getRatingsStats(long statsId)
234 throws PortalException, SystemException {
235 return ratingsStatsPersistence.findByPrimaryKey(statsId);
236 }
237
238 @Override
239 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
240 throws PortalException, SystemException {
241 return ratingsStatsPersistence.findByPrimaryKey(primaryKeyObj);
242 }
243
244
256 @Override
257 public List<RatingsStats> getRatingsStatses(int start, int end)
258 throws SystemException {
259 return ratingsStatsPersistence.findAll(start, end);
260 }
261
262
268 @Override
269 public int getRatingsStatsesCount() throws SystemException {
270 return ratingsStatsPersistence.countAll();
271 }
272
273
280 @Indexable(type = IndexableType.REINDEX)
281 @Override
282 public RatingsStats updateRatingsStats(RatingsStats ratingsStats)
283 throws SystemException {
284 return ratingsStatsPersistence.update(ratingsStats);
285 }
286
287
292 public com.liferay.portlet.ratings.service.RatingsEntryLocalService getRatingsEntryLocalService() {
293 return ratingsEntryLocalService;
294 }
295
296
301 public void setRatingsEntryLocalService(
302 com.liferay.portlet.ratings.service.RatingsEntryLocalService ratingsEntryLocalService) {
303 this.ratingsEntryLocalService = ratingsEntryLocalService;
304 }
305
306
311 public com.liferay.portlet.ratings.service.RatingsEntryService getRatingsEntryService() {
312 return ratingsEntryService;
313 }
314
315
320 public void setRatingsEntryService(
321 com.liferay.portlet.ratings.service.RatingsEntryService ratingsEntryService) {
322 this.ratingsEntryService = ratingsEntryService;
323 }
324
325
330 public RatingsEntryPersistence getRatingsEntryPersistence() {
331 return ratingsEntryPersistence;
332 }
333
334
339 public void setRatingsEntryPersistence(
340 RatingsEntryPersistence ratingsEntryPersistence) {
341 this.ratingsEntryPersistence = ratingsEntryPersistence;
342 }
343
344
349 public RatingsEntryFinder getRatingsEntryFinder() {
350 return ratingsEntryFinder;
351 }
352
353
358 public void setRatingsEntryFinder(RatingsEntryFinder ratingsEntryFinder) {
359 this.ratingsEntryFinder = ratingsEntryFinder;
360 }
361
362
367 public com.liferay.portlet.ratings.service.RatingsStatsLocalService getRatingsStatsLocalService() {
368 return ratingsStatsLocalService;
369 }
370
371
376 public void setRatingsStatsLocalService(
377 com.liferay.portlet.ratings.service.RatingsStatsLocalService ratingsStatsLocalService) {
378 this.ratingsStatsLocalService = ratingsStatsLocalService;
379 }
380
381
386 public RatingsStatsPersistence getRatingsStatsPersistence() {
387 return ratingsStatsPersistence;
388 }
389
390
395 public void setRatingsStatsPersistence(
396 RatingsStatsPersistence ratingsStatsPersistence) {
397 this.ratingsStatsPersistence = ratingsStatsPersistence;
398 }
399
400
405 public RatingsStatsFinder getRatingsStatsFinder() {
406 return ratingsStatsFinder;
407 }
408
409
414 public void setRatingsStatsFinder(RatingsStatsFinder ratingsStatsFinder) {
415 this.ratingsStatsFinder = ratingsStatsFinder;
416 }
417
418
423 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
424 return counterLocalService;
425 }
426
427
432 public void setCounterLocalService(
433 com.liferay.counter.service.CounterLocalService counterLocalService) {
434 this.counterLocalService = counterLocalService;
435 }
436
437
442 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
443 return resourceLocalService;
444 }
445
446
451 public void setResourceLocalService(
452 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
453 this.resourceLocalService = resourceLocalService;
454 }
455
456
461 public com.liferay.portal.service.UserLocalService getUserLocalService() {
462 return userLocalService;
463 }
464
465
470 public void setUserLocalService(
471 com.liferay.portal.service.UserLocalService userLocalService) {
472 this.userLocalService = userLocalService;
473 }
474
475
480 public com.liferay.portal.service.UserService getUserService() {
481 return userService;
482 }
483
484
489 public void setUserService(
490 com.liferay.portal.service.UserService userService) {
491 this.userService = userService;
492 }
493
494
499 public UserPersistence getUserPersistence() {
500 return userPersistence;
501 }
502
503
508 public void setUserPersistence(UserPersistence userPersistence) {
509 this.userPersistence = userPersistence;
510 }
511
512
517 public UserFinder getUserFinder() {
518 return userFinder;
519 }
520
521
526 public void setUserFinder(UserFinder userFinder) {
527 this.userFinder = userFinder;
528 }
529
530 public void afterPropertiesSet() {
531 persistedModelLocalServiceRegistry.register("com.liferay.portlet.ratings.model.RatingsStats",
532 ratingsStatsLocalService);
533 }
534
535 public void destroy() {
536 persistedModelLocalServiceRegistry.unregister(
537 "com.liferay.portlet.ratings.model.RatingsStats");
538 }
539
540
545 @Override
546 public String getBeanIdentifier() {
547 return _beanIdentifier;
548 }
549
550
555 @Override
556 public void setBeanIdentifier(String beanIdentifier) {
557 _beanIdentifier = beanIdentifier;
558 }
559
560 protected Class<?> getModelClass() {
561 return RatingsStats.class;
562 }
563
564 protected String getModelClassName() {
565 return RatingsStats.class.getName();
566 }
567
568
573 protected void runSQL(String sql) throws SystemException {
574 try {
575 DataSource dataSource = ratingsStatsPersistence.getDataSource();
576
577 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
578 sql, new int[0]);
579
580 sqlUpdate.update();
581 }
582 catch (Exception e) {
583 throw new SystemException(e);
584 }
585 }
586
587 @BeanReference(type = com.liferay.portlet.ratings.service.RatingsEntryLocalService.class)
588 protected com.liferay.portlet.ratings.service.RatingsEntryLocalService ratingsEntryLocalService;
589 @BeanReference(type = com.liferay.portlet.ratings.service.RatingsEntryService.class)
590 protected com.liferay.portlet.ratings.service.RatingsEntryService ratingsEntryService;
591 @BeanReference(type = RatingsEntryPersistence.class)
592 protected RatingsEntryPersistence ratingsEntryPersistence;
593 @BeanReference(type = RatingsEntryFinder.class)
594 protected RatingsEntryFinder ratingsEntryFinder;
595 @BeanReference(type = com.liferay.portlet.ratings.service.RatingsStatsLocalService.class)
596 protected com.liferay.portlet.ratings.service.RatingsStatsLocalService ratingsStatsLocalService;
597 @BeanReference(type = RatingsStatsPersistence.class)
598 protected RatingsStatsPersistence ratingsStatsPersistence;
599 @BeanReference(type = RatingsStatsFinder.class)
600 protected RatingsStatsFinder ratingsStatsFinder;
601 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
602 protected com.liferay.counter.service.CounterLocalService counterLocalService;
603 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
604 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
605 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
606 protected com.liferay.portal.service.UserLocalService userLocalService;
607 @BeanReference(type = com.liferay.portal.service.UserService.class)
608 protected com.liferay.portal.service.UserService userService;
609 @BeanReference(type = UserPersistence.class)
610 protected UserPersistence userPersistence;
611 @BeanReference(type = UserFinder.class)
612 protected UserFinder userFinder;
613 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
614 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
615 private String _beanIdentifier;
616 }