1
22
23 package com.liferay.portlet.ratings.service.base;
24
25 import com.liferay.counter.service.CounterLocalService;
26 import com.liferay.counter.service.CounterService;
27
28 import com.liferay.portal.PortalException;
29 import com.liferay.portal.SystemException;
30 import com.liferay.portal.kernel.annotation.BeanReference;
31 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
32 import com.liferay.portal.util.PortalUtil;
33
34 import com.liferay.portlet.ratings.model.RatingsStats;
35 import com.liferay.portlet.ratings.service.RatingsEntryLocalService;
36 import com.liferay.portlet.ratings.service.RatingsEntryService;
37 import com.liferay.portlet.ratings.service.RatingsStatsLocalService;
38 import com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence;
39 import com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence;
40
41 import java.util.List;
42
43
49 public abstract class RatingsStatsLocalServiceBaseImpl
50 implements RatingsStatsLocalService {
51 public RatingsStats addRatingsStats(RatingsStats ratingsStats)
52 throws SystemException {
53 ratingsStats.setNew(true);
54
55 return ratingsStatsPersistence.update(ratingsStats, false);
56 }
57
58 public RatingsStats createRatingsStats(long statsId) {
59 return ratingsStatsPersistence.create(statsId);
60 }
61
62 public void deleteRatingsStats(long statsId)
63 throws PortalException, SystemException {
64 ratingsStatsPersistence.remove(statsId);
65 }
66
67 public void deleteRatingsStats(RatingsStats ratingsStats)
68 throws SystemException {
69 ratingsStatsPersistence.remove(ratingsStats);
70 }
71
72 public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
73 throws SystemException {
74 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery);
75 }
76
77 public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
78 int end) throws SystemException {
79 return ratingsStatsPersistence.findWithDynamicQuery(dynamicQuery,
80 start, end);
81 }
82
83 public RatingsStats getRatingsStats(long statsId)
84 throws PortalException, SystemException {
85 return ratingsStatsPersistence.findByPrimaryKey(statsId);
86 }
87
88 public List<RatingsStats> getRatingsStatses(int start, int end)
89 throws SystemException {
90 return ratingsStatsPersistence.findAll(start, end);
91 }
92
93 public int getRatingsStatsesCount() throws SystemException {
94 return ratingsStatsPersistence.countAll();
95 }
96
97 public RatingsStats updateRatingsStats(RatingsStats ratingsStats)
98 throws SystemException {
99 ratingsStats.setNew(false);
100
101 return ratingsStatsPersistence.update(ratingsStats, true);
102 }
103
104 public RatingsStats updateRatingsStats(RatingsStats ratingsStats,
105 boolean merge) throws SystemException {
106 ratingsStats.setNew(false);
107
108 return ratingsStatsPersistence.update(ratingsStats, merge);
109 }
110
111 public RatingsEntryLocalService getRatingsEntryLocalService() {
112 return ratingsEntryLocalService;
113 }
114
115 public void setRatingsEntryLocalService(
116 RatingsEntryLocalService ratingsEntryLocalService) {
117 this.ratingsEntryLocalService = ratingsEntryLocalService;
118 }
119
120 public RatingsEntryService getRatingsEntryService() {
121 return ratingsEntryService;
122 }
123
124 public void setRatingsEntryService(RatingsEntryService ratingsEntryService) {
125 this.ratingsEntryService = ratingsEntryService;
126 }
127
128 public RatingsEntryPersistence getRatingsEntryPersistence() {
129 return ratingsEntryPersistence;
130 }
131
132 public void setRatingsEntryPersistence(
133 RatingsEntryPersistence ratingsEntryPersistence) {
134 this.ratingsEntryPersistence = ratingsEntryPersistence;
135 }
136
137 public RatingsStatsLocalService getRatingsStatsLocalService() {
138 return ratingsStatsLocalService;
139 }
140
141 public void setRatingsStatsLocalService(
142 RatingsStatsLocalService ratingsStatsLocalService) {
143 this.ratingsStatsLocalService = ratingsStatsLocalService;
144 }
145
146 public RatingsStatsPersistence getRatingsStatsPersistence() {
147 return ratingsStatsPersistence;
148 }
149
150 public void setRatingsStatsPersistence(
151 RatingsStatsPersistence ratingsStatsPersistence) {
152 this.ratingsStatsPersistence = ratingsStatsPersistence;
153 }
154
155 public CounterLocalService getCounterLocalService() {
156 return counterLocalService;
157 }
158
159 public void setCounterLocalService(CounterLocalService counterLocalService) {
160 this.counterLocalService = counterLocalService;
161 }
162
163 public CounterService getCounterService() {
164 return counterService;
165 }
166
167 public void setCounterService(CounterService counterService) {
168 this.counterService = counterService;
169 }
170
171 protected void runSQL(String sql) throws SystemException {
172 try {
173 PortalUtil.runSQL(sql);
174 }
175 catch (Exception e) {
176 throw new SystemException(e);
177 }
178 }
179
180 @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryLocalService.impl")
181 protected RatingsEntryLocalService ratingsEntryLocalService;
182 @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsEntryService.impl")
183 protected RatingsEntryService ratingsEntryService;
184 @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsEntryPersistence.impl")
185 protected RatingsEntryPersistence ratingsEntryPersistence;
186 @BeanReference(name = "com.liferay.portlet.ratings.service.RatingsStatsLocalService.impl")
187 protected RatingsStatsLocalService ratingsStatsLocalService;
188 @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence.impl")
189 protected RatingsStatsPersistence ratingsStatsPersistence;
190 @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
191 protected CounterLocalService counterLocalService;
192 @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
193 protected CounterService counterService;
194 }