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.ExpandoTable;
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 ExpandoTableLocalServiceBaseImpl
073 extends BaseLocalServiceImpl implements ExpandoTableLocalService,
074 IdentifiableBean {
075
080
081
088 @Indexable(type = IndexableType.REINDEX)
089 public ExpandoTable addExpandoTable(ExpandoTable expandoTable)
090 throws SystemException {
091 expandoTable.setNew(true);
092
093 return expandoTablePersistence.update(expandoTable, false);
094 }
095
096
102 public ExpandoTable createExpandoTable(long tableId) {
103 return expandoTablePersistence.create(tableId);
104 }
105
106
114 @Indexable(type = IndexableType.DELETE)
115 public ExpandoTable deleteExpandoTable(long tableId)
116 throws PortalException, SystemException {
117 return expandoTablePersistence.remove(tableId);
118 }
119
120
127 @Indexable(type = IndexableType.DELETE)
128 public ExpandoTable deleteExpandoTable(ExpandoTable expandoTable)
129 throws SystemException {
130 return expandoTablePersistence.remove(expandoTable);
131 }
132
133 public DynamicQuery dynamicQuery() {
134 Class<?> clazz = getClass();
135
136 return DynamicQueryFactoryUtil.forClass(ExpandoTable.class,
137 clazz.getClassLoader());
138 }
139
140
147 @SuppressWarnings("rawtypes")
148 public List dynamicQuery(DynamicQuery dynamicQuery)
149 throws SystemException {
150 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery);
151 }
152
153
166 @SuppressWarnings("rawtypes")
167 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
168 throws SystemException {
169 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
170 start, end);
171 }
172
173
187 @SuppressWarnings("rawtypes")
188 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
189 OrderByComparator orderByComparator) throws SystemException {
190 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
191 start, end, orderByComparator);
192 }
193
194
201 public long dynamicQueryCount(DynamicQuery dynamicQuery)
202 throws SystemException {
203 return expandoTablePersistence.countWithDynamicQuery(dynamicQuery);
204 }
205
206 public ExpandoTable fetchExpandoTable(long tableId)
207 throws SystemException {
208 return expandoTablePersistence.fetchByPrimaryKey(tableId);
209 }
210
211
219 public ExpandoTable getExpandoTable(long tableId)
220 throws PortalException, SystemException {
221 return expandoTablePersistence.findByPrimaryKey(tableId);
222 }
223
224 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
225 throws PortalException, SystemException {
226 return expandoTablePersistence.findByPrimaryKey(primaryKeyObj);
227 }
228
229
241 public List<ExpandoTable> getExpandoTables(int start, int end)
242 throws SystemException {
243 return expandoTablePersistence.findAll(start, end);
244 }
245
246
252 public int getExpandoTablesCount() throws SystemException {
253 return expandoTablePersistence.countAll();
254 }
255
256
263 @Indexable(type = IndexableType.REINDEX)
264 public ExpandoTable updateExpandoTable(ExpandoTable expandoTable)
265 throws SystemException {
266 return updateExpandoTable(expandoTable, true);
267 }
268
269
277 @Indexable(type = IndexableType.REINDEX)
278 public ExpandoTable updateExpandoTable(ExpandoTable expandoTable,
279 boolean merge) throws SystemException {
280 expandoTable.setNew(false);
281
282 return expandoTablePersistence.update(expandoTable, merge);
283 }
284
285
290 public ExpandoColumnLocalService getExpandoColumnLocalService() {
291 return expandoColumnLocalService;
292 }
293
294
299 public void setExpandoColumnLocalService(
300 ExpandoColumnLocalService expandoColumnLocalService) {
301 this.expandoColumnLocalService = expandoColumnLocalService;
302 }
303
304
309 public ExpandoColumnService getExpandoColumnService() {
310 return expandoColumnService;
311 }
312
313
318 public void setExpandoColumnService(
319 ExpandoColumnService expandoColumnService) {
320 this.expandoColumnService = expandoColumnService;
321 }
322
323
328 public ExpandoColumnPersistence getExpandoColumnPersistence() {
329 return expandoColumnPersistence;
330 }
331
332
337 public void setExpandoColumnPersistence(
338 ExpandoColumnPersistence expandoColumnPersistence) {
339 this.expandoColumnPersistence = expandoColumnPersistence;
340 }
341
342
347 public ExpandoRowLocalService getExpandoRowLocalService() {
348 return expandoRowLocalService;
349 }
350
351
356 public void setExpandoRowLocalService(
357 ExpandoRowLocalService expandoRowLocalService) {
358 this.expandoRowLocalService = expandoRowLocalService;
359 }
360
361
366 public ExpandoRowPersistence getExpandoRowPersistence() {
367 return expandoRowPersistence;
368 }
369
370
375 public void setExpandoRowPersistence(
376 ExpandoRowPersistence expandoRowPersistence) {
377 this.expandoRowPersistence = expandoRowPersistence;
378 }
379
380
385 public ExpandoTableLocalService getExpandoTableLocalService() {
386 return expandoTableLocalService;
387 }
388
389
394 public void setExpandoTableLocalService(
395 ExpandoTableLocalService expandoTableLocalService) {
396 this.expandoTableLocalService = expandoTableLocalService;
397 }
398
399
404 public ExpandoTablePersistence getExpandoTablePersistence() {
405 return expandoTablePersistence;
406 }
407
408
413 public void setExpandoTablePersistence(
414 ExpandoTablePersistence expandoTablePersistence) {
415 this.expandoTablePersistence = expandoTablePersistence;
416 }
417
418
423 public ExpandoValueLocalService getExpandoValueLocalService() {
424 return expandoValueLocalService;
425 }
426
427
432 public void setExpandoValueLocalService(
433 ExpandoValueLocalService expandoValueLocalService) {
434 this.expandoValueLocalService = expandoValueLocalService;
435 }
436
437
442 public ExpandoValueService getExpandoValueService() {
443 return expandoValueService;
444 }
445
446
451 public void setExpandoValueService(ExpandoValueService expandoValueService) {
452 this.expandoValueService = expandoValueService;
453 }
454
455
460 public ExpandoValuePersistence getExpandoValuePersistence() {
461 return expandoValuePersistence;
462 }
463
464
469 public void setExpandoValuePersistence(
470 ExpandoValuePersistence expandoValuePersistence) {
471 this.expandoValuePersistence = expandoValuePersistence;
472 }
473
474
479 public CounterLocalService getCounterLocalService() {
480 return counterLocalService;
481 }
482
483
488 public void setCounterLocalService(CounterLocalService counterLocalService) {
489 this.counterLocalService = counterLocalService;
490 }
491
492
497 public ResourceLocalService getResourceLocalService() {
498 return resourceLocalService;
499 }
500
501
506 public void setResourceLocalService(
507 ResourceLocalService resourceLocalService) {
508 this.resourceLocalService = resourceLocalService;
509 }
510
511
516 public ResourceService getResourceService() {
517 return resourceService;
518 }
519
520
525 public void setResourceService(ResourceService resourceService) {
526 this.resourceService = resourceService;
527 }
528
529
534 public ResourcePersistence getResourcePersistence() {
535 return resourcePersistence;
536 }
537
538
543 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
544 this.resourcePersistence = resourcePersistence;
545 }
546
547
552 public ResourceFinder getResourceFinder() {
553 return resourceFinder;
554 }
555
556
561 public void setResourceFinder(ResourceFinder resourceFinder) {
562 this.resourceFinder = resourceFinder;
563 }
564
565
570 public UserLocalService getUserLocalService() {
571 return userLocalService;
572 }
573
574
579 public void setUserLocalService(UserLocalService userLocalService) {
580 this.userLocalService = userLocalService;
581 }
582
583
588 public UserService getUserService() {
589 return userService;
590 }
591
592
597 public void setUserService(UserService userService) {
598 this.userService = userService;
599 }
600
601
606 public UserPersistence getUserPersistence() {
607 return userPersistence;
608 }
609
610
615 public void setUserPersistence(UserPersistence userPersistence) {
616 this.userPersistence = userPersistence;
617 }
618
619
624 public UserFinder getUserFinder() {
625 return userFinder;
626 }
627
628
633 public void setUserFinder(UserFinder userFinder) {
634 this.userFinder = userFinder;
635 }
636
637 public void afterPropertiesSet() {
638 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoTable",
639 expandoTableLocalService);
640 }
641
642 public void destroy() {
643 persistedModelLocalServiceRegistry.unregister(
644 "com.liferay.portlet.expando.model.ExpandoTable");
645 }
646
647
652 public String getBeanIdentifier() {
653 return _beanIdentifier;
654 }
655
656
661 public void setBeanIdentifier(String beanIdentifier) {
662 _beanIdentifier = beanIdentifier;
663 }
664
665 protected Class<?> getModelClass() {
666 return ExpandoTable.class;
667 }
668
669 protected String getModelClassName() {
670 return ExpandoTable.class.getName();
671 }
672
673
678 protected void runSQL(String sql) throws SystemException {
679 try {
680 DataSource dataSource = expandoTablePersistence.getDataSource();
681
682 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
683 sql, new int[0]);
684
685 sqlUpdate.update();
686 }
687 catch (Exception e) {
688 throw new SystemException(e);
689 }
690 }
691
692 @BeanReference(type = ExpandoColumnLocalService.class)
693 protected ExpandoColumnLocalService expandoColumnLocalService;
694 @BeanReference(type = ExpandoColumnService.class)
695 protected ExpandoColumnService expandoColumnService;
696 @BeanReference(type = ExpandoColumnPersistence.class)
697 protected ExpandoColumnPersistence expandoColumnPersistence;
698 @BeanReference(type = ExpandoRowLocalService.class)
699 protected ExpandoRowLocalService expandoRowLocalService;
700 @BeanReference(type = ExpandoRowPersistence.class)
701 protected ExpandoRowPersistence expandoRowPersistence;
702 @BeanReference(type = ExpandoTableLocalService.class)
703 protected ExpandoTableLocalService expandoTableLocalService;
704 @BeanReference(type = ExpandoTablePersistence.class)
705 protected ExpandoTablePersistence expandoTablePersistence;
706 @BeanReference(type = ExpandoValueLocalService.class)
707 protected ExpandoValueLocalService expandoValueLocalService;
708 @BeanReference(type = ExpandoValueService.class)
709 protected ExpandoValueService expandoValueService;
710 @BeanReference(type = ExpandoValuePersistence.class)
711 protected ExpandoValuePersistence expandoValuePersistence;
712 @BeanReference(type = CounterLocalService.class)
713 protected CounterLocalService counterLocalService;
714 @BeanReference(type = ResourceLocalService.class)
715 protected ResourceLocalService resourceLocalService;
716 @BeanReference(type = ResourceService.class)
717 protected ResourceService resourceService;
718 @BeanReference(type = ResourcePersistence.class)
719 protected ResourcePersistence resourcePersistence;
720 @BeanReference(type = ResourceFinder.class)
721 protected ResourceFinder resourceFinder;
722 @BeanReference(type = UserLocalService.class)
723 protected UserLocalService userLocalService;
724 @BeanReference(type = UserService.class)
725 protected UserService userService;
726 @BeanReference(type = UserPersistence.class)
727 protected UserPersistence userPersistence;
728 @BeanReference(type = UserFinder.class)
729 protected UserFinder userFinder;
730 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
731 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
732 private String _beanIdentifier;
733 }