1
14
15 package com.liferay.portlet.expando.service.base;
16
17 import com.liferay.counter.service.CounterLocalService;
18
19 import com.liferay.portal.kernel.annotation.BeanReference;
20 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
21 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
22 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
23 import com.liferay.portal.kernel.exception.PortalException;
24 import com.liferay.portal.kernel.exception.SystemException;
25 import com.liferay.portal.kernel.util.OrderByComparator;
26 import com.liferay.portal.service.ResourceLocalService;
27 import com.liferay.portal.service.ResourceService;
28 import com.liferay.portal.service.UserLocalService;
29 import com.liferay.portal.service.UserService;
30 import com.liferay.portal.service.persistence.ResourceFinder;
31 import com.liferay.portal.service.persistence.ResourcePersistence;
32 import com.liferay.portal.service.persistence.UserFinder;
33 import com.liferay.portal.service.persistence.UserPersistence;
34
35 import com.liferay.portlet.expando.model.ExpandoTable;
36 import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
37 import com.liferay.portlet.expando.service.ExpandoColumnService;
38 import com.liferay.portlet.expando.service.ExpandoRowLocalService;
39 import com.liferay.portlet.expando.service.ExpandoTableLocalService;
40 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
41 import com.liferay.portlet.expando.service.ExpandoValueService;
42 import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
43 import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
44 import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
45 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
46
47 import java.util.List;
48
49 import javax.sql.DataSource;
50
51
57 public abstract class ExpandoTableLocalServiceBaseImpl
58 implements ExpandoTableLocalService {
59 public ExpandoTable addExpandoTable(ExpandoTable expandoTable)
60 throws SystemException {
61 expandoTable.setNew(true);
62
63 return expandoTablePersistence.update(expandoTable, false);
64 }
65
66 public ExpandoTable createExpandoTable(long tableId) {
67 return expandoTablePersistence.create(tableId);
68 }
69
70 public void deleteExpandoTable(long tableId)
71 throws PortalException, SystemException {
72 expandoTablePersistence.remove(tableId);
73 }
74
75 public void deleteExpandoTable(ExpandoTable expandoTable)
76 throws SystemException {
77 expandoTablePersistence.remove(expandoTable);
78 }
79
80 @SuppressWarnings("unchecked")
81 public List dynamicQuery(DynamicQuery dynamicQuery)
82 throws SystemException {
83 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery);
84 }
85
86 @SuppressWarnings("unchecked")
87 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
88 throws SystemException {
89 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
90 start, end);
91 }
92
93 @SuppressWarnings("unchecked")
94 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
95 OrderByComparator orderByComparator) throws SystemException {
96 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
97 start, end, orderByComparator);
98 }
99
100 public long dynamicQueryCount(DynamicQuery dynamicQuery)
101 throws SystemException {
102 return expandoTablePersistence.countWithDynamicQuery(dynamicQuery);
103 }
104
105 public ExpandoTable getExpandoTable(long tableId)
106 throws PortalException, SystemException {
107 return expandoTablePersistence.findByPrimaryKey(tableId);
108 }
109
110 public List<ExpandoTable> getExpandoTables(int start, int end)
111 throws SystemException {
112 return expandoTablePersistence.findAll(start, end);
113 }
114
115 public int getExpandoTablesCount() throws SystemException {
116 return expandoTablePersistence.countAll();
117 }
118
119 public ExpandoTable updateExpandoTable(ExpandoTable expandoTable)
120 throws SystemException {
121 expandoTable.setNew(false);
122
123 return expandoTablePersistence.update(expandoTable, true);
124 }
125
126 public ExpandoTable updateExpandoTable(ExpandoTable expandoTable,
127 boolean merge) throws SystemException {
128 expandoTable.setNew(false);
129
130 return expandoTablePersistence.update(expandoTable, merge);
131 }
132
133 public ExpandoColumnLocalService getExpandoColumnLocalService() {
134 return expandoColumnLocalService;
135 }
136
137 public void setExpandoColumnLocalService(
138 ExpandoColumnLocalService expandoColumnLocalService) {
139 this.expandoColumnLocalService = expandoColumnLocalService;
140 }
141
142 public ExpandoColumnService getExpandoColumnService() {
143 return expandoColumnService;
144 }
145
146 public void setExpandoColumnService(
147 ExpandoColumnService expandoColumnService) {
148 this.expandoColumnService = expandoColumnService;
149 }
150
151 public ExpandoColumnPersistence getExpandoColumnPersistence() {
152 return expandoColumnPersistence;
153 }
154
155 public void setExpandoColumnPersistence(
156 ExpandoColumnPersistence expandoColumnPersistence) {
157 this.expandoColumnPersistence = expandoColumnPersistence;
158 }
159
160 public ExpandoRowLocalService getExpandoRowLocalService() {
161 return expandoRowLocalService;
162 }
163
164 public void setExpandoRowLocalService(
165 ExpandoRowLocalService expandoRowLocalService) {
166 this.expandoRowLocalService = expandoRowLocalService;
167 }
168
169 public ExpandoRowPersistence getExpandoRowPersistence() {
170 return expandoRowPersistence;
171 }
172
173 public void setExpandoRowPersistence(
174 ExpandoRowPersistence expandoRowPersistence) {
175 this.expandoRowPersistence = expandoRowPersistence;
176 }
177
178 public ExpandoTableLocalService getExpandoTableLocalService() {
179 return expandoTableLocalService;
180 }
181
182 public void setExpandoTableLocalService(
183 ExpandoTableLocalService expandoTableLocalService) {
184 this.expandoTableLocalService = expandoTableLocalService;
185 }
186
187 public ExpandoTablePersistence getExpandoTablePersistence() {
188 return expandoTablePersistence;
189 }
190
191 public void setExpandoTablePersistence(
192 ExpandoTablePersistence expandoTablePersistence) {
193 this.expandoTablePersistence = expandoTablePersistence;
194 }
195
196 public ExpandoValueLocalService getExpandoValueLocalService() {
197 return expandoValueLocalService;
198 }
199
200 public void setExpandoValueLocalService(
201 ExpandoValueLocalService expandoValueLocalService) {
202 this.expandoValueLocalService = expandoValueLocalService;
203 }
204
205 public ExpandoValueService getExpandoValueService() {
206 return expandoValueService;
207 }
208
209 public void setExpandoValueService(ExpandoValueService expandoValueService) {
210 this.expandoValueService = expandoValueService;
211 }
212
213 public ExpandoValuePersistence getExpandoValuePersistence() {
214 return expandoValuePersistence;
215 }
216
217 public void setExpandoValuePersistence(
218 ExpandoValuePersistence expandoValuePersistence) {
219 this.expandoValuePersistence = expandoValuePersistence;
220 }
221
222 public CounterLocalService getCounterLocalService() {
223 return counterLocalService;
224 }
225
226 public void setCounterLocalService(CounterLocalService counterLocalService) {
227 this.counterLocalService = counterLocalService;
228 }
229
230 public ResourceLocalService getResourceLocalService() {
231 return resourceLocalService;
232 }
233
234 public void setResourceLocalService(
235 ResourceLocalService resourceLocalService) {
236 this.resourceLocalService = resourceLocalService;
237 }
238
239 public ResourceService getResourceService() {
240 return resourceService;
241 }
242
243 public void setResourceService(ResourceService resourceService) {
244 this.resourceService = resourceService;
245 }
246
247 public ResourcePersistence getResourcePersistence() {
248 return resourcePersistence;
249 }
250
251 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
252 this.resourcePersistence = resourcePersistence;
253 }
254
255 public ResourceFinder getResourceFinder() {
256 return resourceFinder;
257 }
258
259 public void setResourceFinder(ResourceFinder resourceFinder) {
260 this.resourceFinder = resourceFinder;
261 }
262
263 public UserLocalService getUserLocalService() {
264 return userLocalService;
265 }
266
267 public void setUserLocalService(UserLocalService userLocalService) {
268 this.userLocalService = userLocalService;
269 }
270
271 public UserService getUserService() {
272 return userService;
273 }
274
275 public void setUserService(UserService userService) {
276 this.userService = userService;
277 }
278
279 public UserPersistence getUserPersistence() {
280 return userPersistence;
281 }
282
283 public void setUserPersistence(UserPersistence userPersistence) {
284 this.userPersistence = userPersistence;
285 }
286
287 public UserFinder getUserFinder() {
288 return userFinder;
289 }
290
291 public void setUserFinder(UserFinder userFinder) {
292 this.userFinder = userFinder;
293 }
294
295 protected void runSQL(String sql) throws SystemException {
296 try {
297 DataSource dataSource = expandoTablePersistence.getDataSource();
298
299 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
300 sql, new int[0]);
301
302 sqlUpdate.update();
303 }
304 catch (Exception e) {
305 throw new SystemException(e);
306 }
307 }
308
309 @BeanReference(type = ExpandoColumnLocalService.class)
310 protected ExpandoColumnLocalService expandoColumnLocalService;
311 @BeanReference(type = ExpandoColumnService.class)
312 protected ExpandoColumnService expandoColumnService;
313 @BeanReference(type = ExpandoColumnPersistence.class)
314 protected ExpandoColumnPersistence expandoColumnPersistence;
315 @BeanReference(type = ExpandoRowLocalService.class)
316 protected ExpandoRowLocalService expandoRowLocalService;
317 @BeanReference(type = ExpandoRowPersistence.class)
318 protected ExpandoRowPersistence expandoRowPersistence;
319 @BeanReference(type = ExpandoTableLocalService.class)
320 protected ExpandoTableLocalService expandoTableLocalService;
321 @BeanReference(type = ExpandoTablePersistence.class)
322 protected ExpandoTablePersistence expandoTablePersistence;
323 @BeanReference(type = ExpandoValueLocalService.class)
324 protected ExpandoValueLocalService expandoValueLocalService;
325 @BeanReference(type = ExpandoValueService.class)
326 protected ExpandoValueService expandoValueService;
327 @BeanReference(type = ExpandoValuePersistence.class)
328 protected ExpandoValuePersistence expandoValuePersistence;
329 @BeanReference(type = CounterLocalService.class)
330 protected CounterLocalService counterLocalService;
331 @BeanReference(type = ResourceLocalService.class)
332 protected ResourceLocalService resourceLocalService;
333 @BeanReference(type = ResourceService.class)
334 protected ResourceService resourceService;
335 @BeanReference(type = ResourcePersistence.class)
336 protected ResourcePersistence resourcePersistence;
337 @BeanReference(type = ResourceFinder.class)
338 protected ResourceFinder resourceFinder;
339 @BeanReference(type = UserLocalService.class)
340 protected UserLocalService userLocalService;
341 @BeanReference(type = UserService.class)
342 protected UserService userService;
343 @BeanReference(type = UserPersistence.class)
344 protected UserPersistence userPersistence;
345 @BeanReference(type = UserFinder.class)
346 protected UserFinder userFinder;
347 }