[view] use adcs in HQLDataSourceService.getDataSourceProperties
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 02 Aug 2018 15:06:31 +0200
changeset 35059 87e2392210d2
parent 35058 e8c83b19f124
child 35060 ad90890155ff
[view] use adcs in HQLDataSourceService.getDataSourceProperties
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java	Thu Aug 02 14:30:42 2018 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java	Thu Aug 02 15:06:31 2018 +0200
@@ -43,6 +43,7 @@
 import org.openbravo.base.model.domaintype.PrimitiveDomainType;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.base.structure.IdentifierProvider;
+import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.client.kernel.reference.EnumUIDefinition;
 import org.openbravo.client.kernel.reference.ForeignKeyUIDefinition;
@@ -84,10 +85,14 @@
   @Inject
   @Any
   private Instance<HqlInserter> hqlInserters;
+
   @Inject
   @Any
   private Instance<HqlQueryTransformer> hqlQueryTransformers;
 
+  @Inject
+  private ApplicationDictionaryCachedStructures adcs;
+
   @Override
   public List<DataSourceProperty> getDataSourceProperties(Map<String, Object> parameters) {
     // Returns the datasource properties, based on the columns of the table that is going to use the
@@ -96,7 +101,7 @@
     List<DataSourceProperty> dataSourceProperties = new ArrayList<>();
     String tableId = (String) parameters.get("tableId");
     if (tableId != null) {
-      Table table = OBDal.getInstance().get(Table.class, tableId);
+      Table table = adcs.getTable(tableId);
       Entity entity = ModelProvider.getInstance().getEntityByTableId(tableId);
       for (Column column : table.getADColumnList()) {
         final DataSourceProperty dsProperty = new DataSourceProperty();