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