001
014
015 package com.liferay.portlet.expando.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.annotation.BeanReference;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023 import com.liferay.portal.kernel.exception.PortalException;
024 import com.liferay.portal.kernel.exception.SystemException;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026 import com.liferay.portal.service.ResourceLocalService;
027 import com.liferay.portal.service.ResourceService;
028 import com.liferay.portal.service.UserLocalService;
029 import com.liferay.portal.service.UserService;
030 import com.liferay.portal.service.persistence.ResourceFinder;
031 import com.liferay.portal.service.persistence.ResourcePersistence;
032 import com.liferay.portal.service.persistence.UserFinder;
033 import com.liferay.portal.service.persistence.UserPersistence;
034
035 import com.liferay.portlet.expando.model.ExpandoValue;
036 import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
037 import com.liferay.portlet.expando.service.ExpandoColumnService;
038 import com.liferay.portlet.expando.service.ExpandoRowLocalService;
039 import com.liferay.portlet.expando.service.ExpandoTableLocalService;
040 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
041 import com.liferay.portlet.expando.service.ExpandoValueService;
042 import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
043 import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
044 import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
045 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
046
047 import java.util.List;
048
049 import javax.sql.DataSource;
050
051
067 public abstract class ExpandoValueLocalServiceBaseImpl
068 implements ExpandoValueLocalService {
069
076 public ExpandoValue addExpandoValue(ExpandoValue expandoValue)
077 throws SystemException {
078 expandoValue.setNew(true);
079
080 return expandoValuePersistence.update(expandoValue, false);
081 }
082
083
089 public ExpandoValue createExpandoValue(long valueId) {
090 return expandoValuePersistence.create(valueId);
091 }
092
093
100 public void deleteExpandoValue(long valueId)
101 throws PortalException, SystemException {
102 expandoValuePersistence.remove(valueId);
103 }
104
105
111 public void deleteExpandoValue(ExpandoValue expandoValue)
112 throws SystemException {
113 expandoValuePersistence.remove(expandoValue);
114 }
115
116
123 @SuppressWarnings("rawtypes")
124 public List dynamicQuery(DynamicQuery dynamicQuery)
125 throws SystemException {
126 return expandoValuePersistence.findWithDynamicQuery(dynamicQuery);
127 }
128
129
142 @SuppressWarnings("rawtypes")
143 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
144 throws SystemException {
145 return expandoValuePersistence.findWithDynamicQuery(dynamicQuery,
146 start, end);
147 }
148
149
163 @SuppressWarnings("rawtypes")
164 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
165 OrderByComparator orderByComparator) throws SystemException {
166 return expandoValuePersistence.findWithDynamicQuery(dynamicQuery,
167 start, end, orderByComparator);
168 }
169
170
177 public long dynamicQueryCount(DynamicQuery dynamicQuery)
178 throws SystemException {
179 return expandoValuePersistence.countWithDynamicQuery(dynamicQuery);
180 }
181
182
190 public ExpandoValue getExpandoValue(long valueId)
191 throws PortalException, SystemException {
192 return expandoValuePersistence.findByPrimaryKey(valueId);
193 }
194
195
207 public List<ExpandoValue> getExpandoValues(int start, int end)
208 throws SystemException {
209 return expandoValuePersistence.findAll(start, end);
210 }
211
212
218 public int getExpandoValuesCount() throws SystemException {
219 return expandoValuePersistence.countAll();
220 }
221
222
229 public ExpandoValue updateExpandoValue(ExpandoValue expandoValue)
230 throws SystemException {
231 expandoValue.setNew(false);
232
233 return expandoValuePersistence.update(expandoValue, true);
234 }
235
236
244 public ExpandoValue updateExpandoValue(ExpandoValue expandoValue,
245 boolean merge) throws SystemException {
246 expandoValue.setNew(false);
247
248 return expandoValuePersistence.update(expandoValue, merge);
249 }
250
251
256 public ExpandoColumnLocalService getExpandoColumnLocalService() {
257 return expandoColumnLocalService;
258 }
259
260
265 public void setExpandoColumnLocalService(
266 ExpandoColumnLocalService expandoColumnLocalService) {
267 this.expandoColumnLocalService = expandoColumnLocalService;
268 }
269
270
275 public ExpandoColumnService getExpandoColumnService() {
276 return expandoColumnService;
277 }
278
279
284 public void setExpandoColumnService(
285 ExpandoColumnService expandoColumnService) {
286 this.expandoColumnService = expandoColumnService;
287 }
288
289
294 public ExpandoColumnPersistence getExpandoColumnPersistence() {
295 return expandoColumnPersistence;
296 }
297
298
303 public void setExpandoColumnPersistence(
304 ExpandoColumnPersistence expandoColumnPersistence) {
305 this.expandoColumnPersistence = expandoColumnPersistence;
306 }
307
308
313 public ExpandoRowLocalService getExpandoRowLocalService() {
314 return expandoRowLocalService;
315 }
316
317
322 public void setExpandoRowLocalService(
323 ExpandoRowLocalService expandoRowLocalService) {
324 this.expandoRowLocalService = expandoRowLocalService;
325 }
326
327
332 public ExpandoRowPersistence getExpandoRowPersistence() {
333 return expandoRowPersistence;
334 }
335
336
341 public void setExpandoRowPersistence(
342 ExpandoRowPersistence expandoRowPersistence) {
343 this.expandoRowPersistence = expandoRowPersistence;
344 }
345
346
351 public ExpandoTableLocalService getExpandoTableLocalService() {
352 return expandoTableLocalService;
353 }
354
355
360 public void setExpandoTableLocalService(
361 ExpandoTableLocalService expandoTableLocalService) {
362 this.expandoTableLocalService = expandoTableLocalService;
363 }
364
365
370 public ExpandoTablePersistence getExpandoTablePersistence() {
371 return expandoTablePersistence;
372 }
373
374
379 public void setExpandoTablePersistence(
380 ExpandoTablePersistence expandoTablePersistence) {
381 this.expandoTablePersistence = expandoTablePersistence;
382 }
383
384
389 public ExpandoValueLocalService getExpandoValueLocalService() {
390 return expandoValueLocalService;
391 }
392
393
398 public void setExpandoValueLocalService(
399 ExpandoValueLocalService expandoValueLocalService) {
400 this.expandoValueLocalService = expandoValueLocalService;
401 }
402
403
408 public ExpandoValueService getExpandoValueService() {
409 return expandoValueService;
410 }
411
412
417 public void setExpandoValueService(ExpandoValueService expandoValueService) {
418 this.expandoValueService = expandoValueService;
419 }
420
421
426 public ExpandoValuePersistence getExpandoValuePersistence() {
427 return expandoValuePersistence;
428 }
429
430
435 public void setExpandoValuePersistence(
436 ExpandoValuePersistence expandoValuePersistence) {
437 this.expandoValuePersistence = expandoValuePersistence;
438 }
439
440
445 public CounterLocalService getCounterLocalService() {
446 return counterLocalService;
447 }
448
449
454 public void setCounterLocalService(CounterLocalService counterLocalService) {
455 this.counterLocalService = counterLocalService;
456 }
457
458
463 public ResourceLocalService getResourceLocalService() {
464 return resourceLocalService;
465 }
466
467
472 public void setResourceLocalService(
473 ResourceLocalService resourceLocalService) {
474 this.resourceLocalService = resourceLocalService;
475 }
476
477
482 public ResourceService getResourceService() {
483 return resourceService;
484 }
485
486
491 public void setResourceService(ResourceService resourceService) {
492 this.resourceService = resourceService;
493 }
494
495
500 public ResourcePersistence getResourcePersistence() {
501 return resourcePersistence;
502 }
503
504
509 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
510 this.resourcePersistence = resourcePersistence;
511 }
512
513
518 public ResourceFinder getResourceFinder() {
519 return resourceFinder;
520 }
521
522
527 public void setResourceFinder(ResourceFinder resourceFinder) {
528 this.resourceFinder = resourceFinder;
529 }
530
531
536 public UserLocalService getUserLocalService() {
537 return userLocalService;
538 }
539
540
545 public void setUserLocalService(UserLocalService userLocalService) {
546 this.userLocalService = userLocalService;
547 }
548
549
554 public UserService getUserService() {
555 return userService;
556 }
557
558
563 public void setUserService(UserService userService) {
564 this.userService = userService;
565 }
566
567
572 public UserPersistence getUserPersistence() {
573 return userPersistence;
574 }
575
576
581 public void setUserPersistence(UserPersistence userPersistence) {
582 this.userPersistence = userPersistence;
583 }
584
585
590 public UserFinder getUserFinder() {
591 return userFinder;
592 }
593
594
599 public void setUserFinder(UserFinder userFinder) {
600 this.userFinder = userFinder;
601 }
602
603
608 protected void runSQL(String sql) throws SystemException {
609 try {
610 DataSource dataSource = expandoValuePersistence.getDataSource();
611
612 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
613 sql, new int[0]);
614
615 sqlUpdate.update();
616 }
617 catch (Exception e) {
618 throw new SystemException(e);
619 }
620 }
621
622 @BeanReference(type = ExpandoColumnLocalService.class)
623 protected ExpandoColumnLocalService expandoColumnLocalService;
624 @BeanReference(type = ExpandoColumnService.class)
625 protected ExpandoColumnService expandoColumnService;
626 @BeanReference(type = ExpandoColumnPersistence.class)
627 protected ExpandoColumnPersistence expandoColumnPersistence;
628 @BeanReference(type = ExpandoRowLocalService.class)
629 protected ExpandoRowLocalService expandoRowLocalService;
630 @BeanReference(type = ExpandoRowPersistence.class)
631 protected ExpandoRowPersistence expandoRowPersistence;
632 @BeanReference(type = ExpandoTableLocalService.class)
633 protected ExpandoTableLocalService expandoTableLocalService;
634 @BeanReference(type = ExpandoTablePersistence.class)
635 protected ExpandoTablePersistence expandoTablePersistence;
636 @BeanReference(type = ExpandoValueLocalService.class)
637 protected ExpandoValueLocalService expandoValueLocalService;
638 @BeanReference(type = ExpandoValueService.class)
639 protected ExpandoValueService expandoValueService;
640 @BeanReference(type = ExpandoValuePersistence.class)
641 protected ExpandoValuePersistence expandoValuePersistence;
642 @BeanReference(type = CounterLocalService.class)
643 protected CounterLocalService counterLocalService;
644 @BeanReference(type = ResourceLocalService.class)
645 protected ResourceLocalService resourceLocalService;
646 @BeanReference(type = ResourceService.class)
647 protected ResourceService resourceService;
648 @BeanReference(type = ResourcePersistence.class)
649 protected ResourcePersistence resourcePersistence;
650 @BeanReference(type = ResourceFinder.class)
651 protected ResourceFinder resourceFinder;
652 @BeanReference(type = UserLocalService.class)
653 protected UserLocalService userLocalService;
654 @BeanReference(type = UserService.class)
655 protected UserService userService;
656 @BeanReference(type = UserPersistence.class)
657 protected UserPersistence userPersistence;
658 @BeanReference(type = UserFinder.class)
659 protected UserFinder userFinder;
660 }