1
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.PortalException;
31 import com.liferay.portal.SystemException;
32 import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
33
34 import com.liferay.portlet.ratings.model.RatingsStats;
35 import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
36 import com.liferay.portlet.ratings.service.RatingsEntryLocalServiceFactory;
37 import com.liferay.portlet.ratings.service.RatingsEntryService;
38 import com.liferay.portlet.ratings.service.RatingsEntryServiceFactory;
39 import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
40 import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
41 import com.liferay.portlet.ratings.service.persistence.RatingsEntryUtil;
42 import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
43 import com.liferay.portlet.ratings.service.persistence.RatingsStatsUtil;
44
45 import org.springframework.beans.factory.InitializingBean;
46
47 import java.util.List;
48
49
55 public abstract class RatingsStatsLocalServiceBaseImpl
56 implements RatingsStatsLocalService, InitializingBean {
57 public RatingsStats addRatingsStats(RatingsStats ratingsStats)
58 throws SystemException {
59 ratingsStats.setNew(true);
60
61 return ratingsStatsPersistence.update(ratingsStats, false);
62 }
63
64 public void deleteRatingsStats(long statsId)
65 throws PortalException, SystemException {
66 ratingsStatsPersistence.remove(statsId);
67 }
68
69 public void deleteRatingsStats(RatingsStats ratingsStats)
70 throws PortalException, SystemException {
71 ratingsStatsPersistence.remove(ratingsStats);
72 }
73
74 public List<RatingsStats> dynamicQuery(
75 DynamicQueryInitializer queryInitializer) throws SystemException {
76 return ratingsStatsPersistence.findWithDynamicQuery(queryInitializer);
77 }
78
79 public List<RatingsStats> dynamicQuery(
80 DynamicQueryInitializer queryInitializer, int begin, int end)
81 throws SystemException {
82 return ratingsStatsPersistence.findWithDynamicQuery(queryInitializer,
83 begin, end);
84 }
85
86 public RatingsStats updateRatingsStats(RatingsStats ratingsStats)
87 throws SystemException {
88 ratingsStats.setNew(false);
89
90 return ratingsStatsPersistence.update(ratingsStats, true);
91 }
92
93 public RatingsEntryLocalService getRatingsEntryLocalService() {
94 return ratingsEntryLocalService;
95 }
96
97 public void setRatingsEntryLocalService(
98 RatingsEntryLocalService ratingsEntryLocalService) {
99 this.ratingsEntryLocalService = ratingsEntryLocalService;
100 }
101
102 public RatingsEntryService getRatingsEntryService() {
103 return ratingsEntryService;
104 }
105
106 public void setRatingsEntryService(RatingsEntryService ratingsEntryService) {
107 this.ratingsEntryService = ratingsEntryService;
108 }
109
110 public RatingsEntryPersistence getRatingsEntryPersistence() {
111 return ratingsEntryPersistence;
112 }
113
114 public void setRatingsEntryPersistence(
115 RatingsEntryPersistence ratingsEntryPersistence) {
116 this.ratingsEntryPersistence = ratingsEntryPersistence;
117 }
118
119 public RatingsStatsPersistence getRatingsStatsPersistence() {
120 return ratingsStatsPersistence;
121 }
122
123 public void setRatingsStatsPersistence(
124 RatingsStatsPersistence ratingsStatsPersistence) {
125 this.ratingsStatsPersistence = ratingsStatsPersistence;
126 }
127
128 public CounterLocalService getCounterLocalService() {
129 return counterLocalService;
130 }
131
132 public void setCounterLocalService(CounterLocalService counterLocalService) {
133 this.counterLocalService = counterLocalService;
134 }
135
136 public CounterService getCounterService() {
137 return counterService;
138 }
139
140 public void setCounterService(CounterService counterService) {
141 this.counterService = counterService;
142 }
143
144 public void afterPropertiesSet() {
145 if (ratingsEntryLocalService == null) {
146 ratingsEntryLocalService = RatingsEntryLocalServiceFactory.getImpl();
147 }
148
149 if (ratingsEntryService == null) {
150 ratingsEntryService = RatingsEntryServiceFactory.getImpl();
151 }
152
153 if (ratingsEntryPersistence == null) {
154 ratingsEntryPersistence = RatingsEntryUtil.getPersistence();
155 }
156
157 if (ratingsStatsPersistence == null) {
158 ratingsStatsPersistence = RatingsStatsUtil.getPersistence();
159 }
160
161 if (counterLocalService == null) {
162 counterLocalService = CounterLocalServiceFactory.getImpl();
163 }
164
165 if (counterService == null) {
166 counterService = CounterServiceFactory.getImpl();
167 }
168 }
169
170 protected RatingsEntryLocalService ratingsEntryLocalService;
171 protected RatingsEntryService ratingsEntryService;
172 protected RatingsEntryPersistence ratingsEntryPersistence;
173 protected RatingsStatsPersistence ratingsStatsPersistence;
174 protected CounterLocalService counterLocalService;
175 protected CounterService counterService;
176 }