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.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.asset.service.AssetEntryLocalService;
043 import com.liferay.portlet.asset.service.AssetEntryService;
044 import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
045 import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
046 import com.liferay.portlet.blogs.service.BlogsEntryLocalService;
047 import com.liferay.portlet.blogs.service.BlogsEntryService;
048 import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
049 import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
050 import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
051 import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
052 import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
053 import com.liferay.portlet.ratings.model.RatingsEntry;
054 import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
055 import com.liferay.portlet.ratings.service.RatingsEntryService;
056 import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
057 import com.liferay.portlet.ratings.service.persistence.RatingsEntryFinder;
058 import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
059 import com.liferay.portlet.ratings.service.persistence.RatingsStatsFinder;
060 import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
061 import com.liferay.portlet.social.service.SocialActivityLocalService;
062 import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
063 import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
064
065 import java.io.Serializable;
066
067 import java.util.List;
068
069 import javax.sql.DataSource;
070
071
083 public abstract class RatingsEntryLocalServiceBaseImpl
084 extends BaseLocalServiceImpl implements RatingsEntryLocalService,
085 IdentifiableBean {
086
091
092
099 @Indexable(type = IndexableType.REINDEX)
100 public RatingsEntry addRatingsEntry(RatingsEntry ratingsEntry)
101 throws SystemException {
102 ratingsEntry.setNew(true);
103
104 return ratingsEntryPersistence.update(ratingsEntry, false);
105 }
106
107
113 public RatingsEntry createRatingsEntry(long entryId) {
114 return ratingsEntryPersistence.create(entryId);
115 }
116
117
125 @Indexable(type = IndexableType.DELETE)
126 public RatingsEntry deleteRatingsEntry(long entryId)
127 throws PortalException, SystemException {
128 return ratingsEntryPersistence.remove(entryId);
129 }
130
131
138 @Indexable(type = IndexableType.DELETE)
139 public RatingsEntry deleteRatingsEntry(RatingsEntry ratingsEntry)
140 throws SystemException {
141 return ratingsEntryPersistence.remove(ratingsEntry);
142 }
143
144 public DynamicQuery dynamicQuery() {
145 Class<?> clazz = getClass();
146
147 return DynamicQueryFactoryUtil.forClass(RatingsEntry.class,
148 clazz.getClassLoader());
149 }
150
151
158 @SuppressWarnings("rawtypes")
159 public List dynamicQuery(DynamicQuery dynamicQuery)
160 throws SystemException {
161 return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery);
162 }
163
164
177 @SuppressWarnings("rawtypes")
178 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
179 throws SystemException {
180 return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery,
181 start, end);
182 }
183
184
198 @SuppressWarnings("rawtypes")
199 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
200 OrderByComparator orderByComparator) throws SystemException {
201 return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery,
202 start, end, orderByComparator);
203 }
204
205
212 public long dynamicQueryCount(DynamicQuery dynamicQuery)
213 throws SystemException {
214 return ratingsEntryPersistence.countWithDynamicQuery(dynamicQuery);
215 }
216
217 public RatingsEntry fetchRatingsEntry(long entryId)
218 throws SystemException {
219 return ratingsEntryPersistence.fetchByPrimaryKey(entryId);
220 }
221
222
230 public RatingsEntry getRatingsEntry(long entryId)
231 throws PortalException, SystemException {
232 return ratingsEntryPersistence.findByPrimaryKey(entryId);
233 }
234
235 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
236 throws PortalException, SystemException {
237 return ratingsEntryPersistence.findByPrimaryKey(primaryKeyObj);
238 }
239
240
252 public List<RatingsEntry> getRatingsEntries(int start, int end)
253 throws SystemException {
254 return ratingsEntryPersistence.findAll(start, end);
255 }
256
257
263 public int getRatingsEntriesCount() throws SystemException {
264 return ratingsEntryPersistence.countAll();
265 }
266
267
274 @Indexable(type = IndexableType.REINDEX)
275 public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry)
276 throws SystemException {
277 return updateRatingsEntry(ratingsEntry, true);
278 }
279
280
288 @Indexable(type = IndexableType.REINDEX)
289 public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry,
290 boolean merge) throws SystemException {
291 ratingsEntry.setNew(false);
292
293 return ratingsEntryPersistence.update(ratingsEntry, merge);
294 }
295
296
301 public RatingsEntryLocalService getRatingsEntryLocalService() {
302 return ratingsEntryLocalService;
303 }
304
305
310 public void setRatingsEntryLocalService(
311 RatingsEntryLocalService ratingsEntryLocalService) {
312 this.ratingsEntryLocalService = ratingsEntryLocalService;
313 }
314
315
320 public RatingsEntryService getRatingsEntryService() {
321 return ratingsEntryService;
322 }
323
324
329 public void setRatingsEntryService(RatingsEntryService ratingsEntryService) {
330 this.ratingsEntryService = ratingsEntryService;
331 }
332
333
338 public RatingsEntryPersistence getRatingsEntryPersistence() {
339 return ratingsEntryPersistence;
340 }
341
342
347 public void setRatingsEntryPersistence(
348 RatingsEntryPersistence ratingsEntryPersistence) {
349 this.ratingsEntryPersistence = ratingsEntryPersistence;
350 }
351
352
357 public RatingsEntryFinder getRatingsEntryFinder() {
358 return ratingsEntryFinder;
359 }
360
361
366 public void setRatingsEntryFinder(RatingsEntryFinder ratingsEntryFinder) {
367 this.ratingsEntryFinder = ratingsEntryFinder;
368 }
369
370
375 public RatingsStatsLocalService getRatingsStatsLocalService() {
376 return ratingsStatsLocalService;
377 }
378
379
384 public void setRatingsStatsLocalService(
385 RatingsStatsLocalService ratingsStatsLocalService) {
386 this.ratingsStatsLocalService = ratingsStatsLocalService;
387 }
388
389
394 public RatingsStatsPersistence getRatingsStatsPersistence() {
395 return ratingsStatsPersistence;
396 }
397
398
403 public void setRatingsStatsPersistence(
404 RatingsStatsPersistence ratingsStatsPersistence) {
405 this.ratingsStatsPersistence = ratingsStatsPersistence;
406 }
407
408
413 public RatingsStatsFinder getRatingsStatsFinder() {
414 return ratingsStatsFinder;
415 }
416
417
422 public void setRatingsStatsFinder(RatingsStatsFinder ratingsStatsFinder) {
423 this.ratingsStatsFinder = ratingsStatsFinder;
424 }
425
426
431 public CounterLocalService getCounterLocalService() {
432 return counterLocalService;
433 }
434
435
440 public void setCounterLocalService(CounterLocalService counterLocalService) {
441 this.counterLocalService = counterLocalService;
442 }
443
444
449 public ResourceLocalService getResourceLocalService() {
450 return resourceLocalService;
451 }
452
453
458 public void setResourceLocalService(
459 ResourceLocalService resourceLocalService) {
460 this.resourceLocalService = resourceLocalService;
461 }
462
463
468 public ResourceService getResourceService() {
469 return resourceService;
470 }
471
472
477 public void setResourceService(ResourceService resourceService) {
478 this.resourceService = resourceService;
479 }
480
481
486 public ResourcePersistence getResourcePersistence() {
487 return resourcePersistence;
488 }
489
490
495 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
496 this.resourcePersistence = resourcePersistence;
497 }
498
499
504 public ResourceFinder getResourceFinder() {
505 return resourceFinder;
506 }
507
508
513 public void setResourceFinder(ResourceFinder resourceFinder) {
514 this.resourceFinder = resourceFinder;
515 }
516
517
522 public UserLocalService getUserLocalService() {
523 return userLocalService;
524 }
525
526
531 public void setUserLocalService(UserLocalService userLocalService) {
532 this.userLocalService = userLocalService;
533 }
534
535
540 public UserService getUserService() {
541 return userService;
542 }
543
544
549 public void setUserService(UserService userService) {
550 this.userService = userService;
551 }
552
553
558 public UserPersistence getUserPersistence() {
559 return userPersistence;
560 }
561
562
567 public void setUserPersistence(UserPersistence userPersistence) {
568 this.userPersistence = userPersistence;
569 }
570
571
576 public UserFinder getUserFinder() {
577 return userFinder;
578 }
579
580
585 public void setUserFinder(UserFinder userFinder) {
586 this.userFinder = userFinder;
587 }
588
589
594 public AssetEntryLocalService getAssetEntryLocalService() {
595 return assetEntryLocalService;
596 }
597
598
603 public void setAssetEntryLocalService(
604 AssetEntryLocalService assetEntryLocalService) {
605 this.assetEntryLocalService = assetEntryLocalService;
606 }
607
608
613 public AssetEntryService getAssetEntryService() {
614 return assetEntryService;
615 }
616
617
622 public void setAssetEntryService(AssetEntryService assetEntryService) {
623 this.assetEntryService = assetEntryService;
624 }
625
626
631 public AssetEntryPersistence getAssetEntryPersistence() {
632 return assetEntryPersistence;
633 }
634
635
640 public void setAssetEntryPersistence(
641 AssetEntryPersistence assetEntryPersistence) {
642 this.assetEntryPersistence = assetEntryPersistence;
643 }
644
645
650 public AssetEntryFinder getAssetEntryFinder() {
651 return assetEntryFinder;
652 }
653
654
659 public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
660 this.assetEntryFinder = assetEntryFinder;
661 }
662
663
668 public BlogsEntryLocalService getBlogsEntryLocalService() {
669 return blogsEntryLocalService;
670 }
671
672
677 public void setBlogsEntryLocalService(
678 BlogsEntryLocalService blogsEntryLocalService) {
679 this.blogsEntryLocalService = blogsEntryLocalService;
680 }
681
682
687 public BlogsEntryService getBlogsEntryService() {
688 return blogsEntryService;
689 }
690
691
696 public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
697 this.blogsEntryService = blogsEntryService;
698 }
699
700
705 public BlogsEntryPersistence getBlogsEntryPersistence() {
706 return blogsEntryPersistence;
707 }
708
709
714 public void setBlogsEntryPersistence(
715 BlogsEntryPersistence blogsEntryPersistence) {
716 this.blogsEntryPersistence = blogsEntryPersistence;
717 }
718
719
724 public BlogsEntryFinder getBlogsEntryFinder() {
725 return blogsEntryFinder;
726 }
727
728
733 public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
734 this.blogsEntryFinder = blogsEntryFinder;
735 }
736
737
742 public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
743 return blogsStatsUserLocalService;
744 }
745
746
751 public void setBlogsStatsUserLocalService(
752 BlogsStatsUserLocalService blogsStatsUserLocalService) {
753 this.blogsStatsUserLocalService = blogsStatsUserLocalService;
754 }
755
756
761 public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
762 return blogsStatsUserPersistence;
763 }
764
765
770 public void setBlogsStatsUserPersistence(
771 BlogsStatsUserPersistence blogsStatsUserPersistence) {
772 this.blogsStatsUserPersistence = blogsStatsUserPersistence;
773 }
774
775
780 public BlogsStatsUserFinder getBlogsStatsUserFinder() {
781 return blogsStatsUserFinder;
782 }
783
784
789 public void setBlogsStatsUserFinder(
790 BlogsStatsUserFinder blogsStatsUserFinder) {
791 this.blogsStatsUserFinder = blogsStatsUserFinder;
792 }
793
794
799 public SocialActivityLocalService getSocialActivityLocalService() {
800 return socialActivityLocalService;
801 }
802
803
808 public void setSocialActivityLocalService(
809 SocialActivityLocalService socialActivityLocalService) {
810 this.socialActivityLocalService = socialActivityLocalService;
811 }
812
813
818 public SocialActivityPersistence getSocialActivityPersistence() {
819 return socialActivityPersistence;
820 }
821
822
827 public void setSocialActivityPersistence(
828 SocialActivityPersistence socialActivityPersistence) {
829 this.socialActivityPersistence = socialActivityPersistence;
830 }
831
832
837 public SocialActivityFinder getSocialActivityFinder() {
838 return socialActivityFinder;
839 }
840
841
846 public void setSocialActivityFinder(
847 SocialActivityFinder socialActivityFinder) {
848 this.socialActivityFinder = socialActivityFinder;
849 }
850
851 public void afterPropertiesSet() {
852 persistedModelLocalServiceRegistry.register("com.liferay.portlet.ratings.model.RatingsEntry",
853 ratingsEntryLocalService);
854 }
855
856 public void destroy() {
857 persistedModelLocalServiceRegistry.unregister(
858 "com.liferay.portlet.ratings.model.RatingsEntry");
859 }
860
861
866 public String getBeanIdentifier() {
867 return _beanIdentifier;
868 }
869
870
875 public void setBeanIdentifier(String beanIdentifier) {
876 _beanIdentifier = beanIdentifier;
877 }
878
879 protected Class<?> getModelClass() {
880 return RatingsEntry.class;
881 }
882
883 protected String getModelClassName() {
884 return RatingsEntry.class.getName();
885 }
886
887
892 protected void runSQL(String sql) throws SystemException {
893 try {
894 DataSource dataSource = ratingsEntryPersistence.getDataSource();
895
896 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
897 sql, new int[0]);
898
899 sqlUpdate.update();
900 }
901 catch (Exception e) {
902 throw new SystemException(e);
903 }
904 }
905
906 @BeanReference(type = RatingsEntryLocalService.class)
907 protected RatingsEntryLocalService ratingsEntryLocalService;
908 @BeanReference(type = RatingsEntryService.class)
909 protected RatingsEntryService ratingsEntryService;
910 @BeanReference(type = RatingsEntryPersistence.class)
911 protected RatingsEntryPersistence ratingsEntryPersistence;
912 @BeanReference(type = RatingsEntryFinder.class)
913 protected RatingsEntryFinder ratingsEntryFinder;
914 @BeanReference(type = RatingsStatsLocalService.class)
915 protected RatingsStatsLocalService ratingsStatsLocalService;
916 @BeanReference(type = RatingsStatsPersistence.class)
917 protected RatingsStatsPersistence ratingsStatsPersistence;
918 @BeanReference(type = RatingsStatsFinder.class)
919 protected RatingsStatsFinder ratingsStatsFinder;
920 @BeanReference(type = CounterLocalService.class)
921 protected CounterLocalService counterLocalService;
922 @BeanReference(type = ResourceLocalService.class)
923 protected ResourceLocalService resourceLocalService;
924 @BeanReference(type = ResourceService.class)
925 protected ResourceService resourceService;
926 @BeanReference(type = ResourcePersistence.class)
927 protected ResourcePersistence resourcePersistence;
928 @BeanReference(type = ResourceFinder.class)
929 protected ResourceFinder resourceFinder;
930 @BeanReference(type = UserLocalService.class)
931 protected UserLocalService userLocalService;
932 @BeanReference(type = UserService.class)
933 protected UserService userService;
934 @BeanReference(type = UserPersistence.class)
935 protected UserPersistence userPersistence;
936 @BeanReference(type = UserFinder.class)
937 protected UserFinder userFinder;
938 @BeanReference(type = AssetEntryLocalService.class)
939 protected AssetEntryLocalService assetEntryLocalService;
940 @BeanReference(type = AssetEntryService.class)
941 protected AssetEntryService assetEntryService;
942 @BeanReference(type = AssetEntryPersistence.class)
943 protected AssetEntryPersistence assetEntryPersistence;
944 @BeanReference(type = AssetEntryFinder.class)
945 protected AssetEntryFinder assetEntryFinder;
946 @BeanReference(type = BlogsEntryLocalService.class)
947 protected BlogsEntryLocalService blogsEntryLocalService;
948 @BeanReference(type = BlogsEntryService.class)
949 protected BlogsEntryService blogsEntryService;
950 @BeanReference(type = BlogsEntryPersistence.class)
951 protected BlogsEntryPersistence blogsEntryPersistence;
952 @BeanReference(type = BlogsEntryFinder.class)
953 protected BlogsEntryFinder blogsEntryFinder;
954 @BeanReference(type = BlogsStatsUserLocalService.class)
955 protected BlogsStatsUserLocalService blogsStatsUserLocalService;
956 @BeanReference(type = BlogsStatsUserPersistence.class)
957 protected BlogsStatsUserPersistence blogsStatsUserPersistence;
958 @BeanReference(type = BlogsStatsUserFinder.class)
959 protected BlogsStatsUserFinder blogsStatsUserFinder;
960 @BeanReference(type = SocialActivityLocalService.class)
961 protected SocialActivityLocalService socialActivityLocalService;
962 @BeanReference(type = SocialActivityPersistence.class)
963 protected SocialActivityPersistence socialActivityPersistence;
964 @BeanReference(type = SocialActivityFinder.class)
965 protected SocialActivityFinder socialActivityFinder;
966 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
967 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
968 private String _beanIdentifier;
969 }