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.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.expando.model.ExpandoRow;
043 import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
044 import com.liferay.portlet.expando.service.ExpandoColumnService;
045 import com.liferay.portlet.expando.service.ExpandoRowLocalService;
046 import com.liferay.portlet.expando.service.ExpandoTableLocalService;
047 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
048 import com.liferay.portlet.expando.service.ExpandoValueService;
049 import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
050 import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
051 import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
052 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
053
054 import java.io.Serializable;
055
056 import java.util.List;
057
058 import javax.sql.DataSource;
059
060
072 public abstract class ExpandoRowLocalServiceBaseImpl
073 extends BaseLocalServiceImpl implements ExpandoRowLocalService,
074 IdentifiableBean {
075
080
081
088 @Indexable(type = IndexableType.REINDEX)
089 public ExpandoRow addExpandoRow(ExpandoRow expandoRow)
090 throws SystemException {
091 expandoRow.setNew(true);
092
093 return expandoRowPersistence.update(expandoRow, false);
094 }
095
096
102 public ExpandoRow createExpandoRow(long rowId) {
103 return expandoRowPersistence.create(rowId);
104 }
105
106
114 @Indexable(type = IndexableType.DELETE)
115 public ExpandoRow deleteExpandoRow(long rowId)
116 throws PortalException, SystemException {
117 return expandoRowPersistence.remove(rowId);
118 }
119
120
127 @Indexable(type = IndexableType.DELETE)
128 public ExpandoRow deleteExpandoRow(ExpandoRow expandoRow)
129 throws SystemException {
130 return expandoRowPersistence.remove(expandoRow);
131 }
132
133 public DynamicQuery dynamicQuery() {
134 Class<?> clazz = getClass();
135
136 return DynamicQueryFactoryUtil.forClass(ExpandoRow.class,
137 clazz.getClassLoader());
138 }
139
140
147 @SuppressWarnings("rawtypes")
148 public List dynamicQuery(DynamicQuery dynamicQuery)
149 throws SystemException {
150 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery);
151 }
152
153
166 @SuppressWarnings("rawtypes")
167 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
168 throws SystemException {
169 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
170 end);
171 }
172
173
187 @SuppressWarnings("rawtypes")
188 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
189 OrderByComparator orderByComparator) throws SystemException {
190 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
191 end, orderByComparator);
192 }
193
194
201 public long dynamicQueryCount(DynamicQuery dynamicQuery)
202 throws SystemException {
203 return expandoRowPersistence.countWithDynamicQuery(dynamicQuery);
204 }
205
206 public ExpandoRow fetchExpandoRow(long rowId) throws SystemException {
207 return expandoRowPersistence.fetchByPrimaryKey(rowId);
208 }
209
210
218 public ExpandoRow getExpandoRow(long rowId)
219 throws PortalException, SystemException {
220 return expandoRowPersistence.findByPrimaryKey(rowId);
221 }
222
223 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
224 throws PortalException, SystemException {
225 return expandoRowPersistence.findByPrimaryKey(primaryKeyObj);
226 }
227
228
240 public List<ExpandoRow> getExpandoRows(int start, int end)
241 throws SystemException {
242 return expandoRowPersistence.findAll(start, end);
243 }
244
245
251 public int getExpandoRowsCount() throws SystemException {
252 return expandoRowPersistence.countAll();
253 }
254
255
262 @Indexable(type = IndexableType.REINDEX)
263 public ExpandoRow updateExpandoRow(ExpandoRow expandoRow)
264 throws SystemException {
265 return updateExpandoRow(expandoRow, true);
266 }
267
268
276 @Indexable(type = IndexableType.REINDEX)
277 public ExpandoRow updateExpandoRow(ExpandoRow expandoRow, boolean merge)
278 throws SystemException {
279 expandoRow.setNew(false);
280
281 return expandoRowPersistence.update(expandoRow, merge);
282 }
283
284
289 public ExpandoColumnLocalService getExpandoColumnLocalService() {
290 return expandoColumnLocalService;
291 }
292
293
298 public void setExpandoColumnLocalService(
299 ExpandoColumnLocalService expandoColumnLocalService) {
300 this.expandoColumnLocalService = expandoColumnLocalService;
301 }
302
303
308 public ExpandoColumnService getExpandoColumnService() {
309 return expandoColumnService;
310 }
311
312
317 public void setExpandoColumnService(
318 ExpandoColumnService expandoColumnService) {
319 this.expandoColumnService = expandoColumnService;
320 }
321
322
327 public ExpandoColumnPersistence getExpandoColumnPersistence() {
328 return expandoColumnPersistence;
329 }
330
331
336 public void setExpandoColumnPersistence(
337 ExpandoColumnPersistence expandoColumnPersistence) {
338 this.expandoColumnPersistence = expandoColumnPersistence;
339 }
340
341
346 public ExpandoRowLocalService getExpandoRowLocalService() {
347 return expandoRowLocalService;
348 }
349
350
355 public void setExpandoRowLocalService(
356 ExpandoRowLocalService expandoRowLocalService) {
357 this.expandoRowLocalService = expandoRowLocalService;
358 }
359
360
365 public ExpandoRowPersistence getExpandoRowPersistence() {
366 return expandoRowPersistence;
367 }
368
369
374 public void setExpandoRowPersistence(
375 ExpandoRowPersistence expandoRowPersistence) {
376 this.expandoRowPersistence = expandoRowPersistence;
377 }
378
379
384 public ExpandoTableLocalService getExpandoTableLocalService() {
385 return expandoTableLocalService;
386 }
387
388
393 public void setExpandoTableLocalService(
394 ExpandoTableLocalService expandoTableLocalService) {
395 this.expandoTableLocalService = expandoTableLocalService;
396 }
397
398
403 public ExpandoTablePersistence getExpandoTablePersistence() {
404 return expandoTablePersistence;
405 }
406
407
412 public void setExpandoTablePersistence(
413 ExpandoTablePersistence expandoTablePersistence) {
414 this.expandoTablePersistence = expandoTablePersistence;
415 }
416
417
422 public ExpandoValueLocalService getExpandoValueLocalService() {
423 return expandoValueLocalService;
424 }
425
426
431 public void setExpandoValueLocalService(
432 ExpandoValueLocalService expandoValueLocalService) {
433 this.expandoValueLocalService = expandoValueLocalService;
434 }
435
436
441 public ExpandoValueService getExpandoValueService() {
442 return expandoValueService;
443 }
444
445
450 public void setExpandoValueService(ExpandoValueService expandoValueService) {
451 this.expandoValueService = expandoValueService;
452 }
453
454
459 public ExpandoValuePersistence getExpandoValuePersistence() {
460 return expandoValuePersistence;
461 }
462
463
468 public void setExpandoValuePersistence(
469 ExpandoValuePersistence expandoValuePersistence) {
470 this.expandoValuePersistence = expandoValuePersistence;
471 }
472
473
478 public CounterLocalService getCounterLocalService() {
479 return counterLocalService;
480 }
481
482
487 public void setCounterLocalService(CounterLocalService counterLocalService) {
488 this.counterLocalService = counterLocalService;
489 }
490
491
496 public ResourceLocalService getResourceLocalService() {
497 return resourceLocalService;
498 }
499
500
505 public void setResourceLocalService(
506 ResourceLocalService resourceLocalService) {
507 this.resourceLocalService = resourceLocalService;
508 }
509
510
515 public ResourceService getResourceService() {
516 return resourceService;
517 }
518
519
524 public void setResourceService(ResourceService resourceService) {
525 this.resourceService = resourceService;
526 }
527
528
533 public ResourcePersistence getResourcePersistence() {
534 return resourcePersistence;
535 }
536
537
542 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
543 this.resourcePersistence = resourcePersistence;
544 }
545
546
551 public ResourceFinder getResourceFinder() {
552 return resourceFinder;
553 }
554
555
560 public void setResourceFinder(ResourceFinder resourceFinder) {
561 this.resourceFinder = resourceFinder;
562 }
563
564
569 public UserLocalService getUserLocalService() {
570 return userLocalService;
571 }
572
573
578 public void setUserLocalService(UserLocalService userLocalService) {
579 this.userLocalService = userLocalService;
580 }
581
582
587 public UserService getUserService() {
588 return userService;
589 }
590
591
596 public void setUserService(UserService userService) {
597 this.userService = userService;
598 }
599
600
605 public UserPersistence getUserPersistence() {
606 return userPersistence;
607 }
608
609
614 public void setUserPersistence(UserPersistence userPersistence) {
615 this.userPersistence = userPersistence;
616 }
617
618
623 public UserFinder getUserFinder() {
624 return userFinder;
625 }
626
627
632 public void setUserFinder(UserFinder userFinder) {
633 this.userFinder = userFinder;
634 }
635
636 public void afterPropertiesSet() {
637 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoRow",
638 expandoRowLocalService);
639 }
640
641 public void destroy() {
642 persistedModelLocalServiceRegistry.unregister(
643 "com.liferay.portlet.expando.model.ExpandoRow");
644 }
645
646
651 public String getBeanIdentifier() {
652 return _beanIdentifier;
653 }
654
655
660 public void setBeanIdentifier(String beanIdentifier) {
661 _beanIdentifier = beanIdentifier;
662 }
663
664 protected Class<?> getModelClass() {
665 return ExpandoRow.class;
666 }
667
668 protected String getModelClassName() {
669 return ExpandoRow.class.getName();
670 }
671
672
677 protected void runSQL(String sql) throws SystemException {
678 try {
679 DataSource dataSource = expandoRowPersistence.getDataSource();
680
681 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
682 sql, new int[0]);
683
684 sqlUpdate.update();
685 }
686 catch (Exception e) {
687 throw new SystemException(e);
688 }
689 }
690
691 @BeanReference(type = ExpandoColumnLocalService.class)
692 protected ExpandoColumnLocalService expandoColumnLocalService;
693 @BeanReference(type = ExpandoColumnService.class)
694 protected ExpandoColumnService expandoColumnService;
695 @BeanReference(type = ExpandoColumnPersistence.class)
696 protected ExpandoColumnPersistence expandoColumnPersistence;
697 @BeanReference(type = ExpandoRowLocalService.class)
698 protected ExpandoRowLocalService expandoRowLocalService;
699 @BeanReference(type = ExpandoRowPersistence.class)
700 protected ExpandoRowPersistence expandoRowPersistence;
701 @BeanReference(type = ExpandoTableLocalService.class)
702 protected ExpandoTableLocalService expandoTableLocalService;
703 @BeanReference(type = ExpandoTablePersistence.class)
704 protected ExpandoTablePersistence expandoTablePersistence;
705 @BeanReference(type = ExpandoValueLocalService.class)
706 protected ExpandoValueLocalService expandoValueLocalService;
707 @BeanReference(type = ExpandoValueService.class)
708 protected ExpandoValueService expandoValueService;
709 @BeanReference(type = ExpandoValuePersistence.class)
710 protected ExpandoValuePersistence expandoValuePersistence;
711 @BeanReference(type = CounterLocalService.class)
712 protected CounterLocalService counterLocalService;
713 @BeanReference(type = ResourceLocalService.class)
714 protected ResourceLocalService resourceLocalService;
715 @BeanReference(type = ResourceService.class)
716 protected ResourceService resourceService;
717 @BeanReference(type = ResourcePersistence.class)
718 protected ResourcePersistence resourcePersistence;
719 @BeanReference(type = ResourceFinder.class)
720 protected ResourceFinder resourceFinder;
721 @BeanReference(type = UserLocalService.class)
722 protected UserLocalService userLocalService;
723 @BeanReference(type = UserService.class)
724 protected UserService userService;
725 @BeanReference(type = UserPersistence.class)
726 protected UserPersistence userPersistence;
727 @BeanReference(type = UserFinder.class)
728 protected UserFinder userFinder;
729 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
730 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
731 private String _beanIdentifier;
732 }