Hi there,
I am excited seeing “Value Datasources” is added in ver 6.4.0: Value Datasources - CUBA Platform. Developer’s Manual
However, it can not be recognized in XML declaration file (sales.xml) with error “Element valueCollectionDatasource is not allowed here” shown in IntelliJ:
<dsContext>
<valueCollectionDatasource id="salesAggregatorDs">
<query>
<![CDATA[select o.orderDate, sum(o.amount) from posportal$Order o group by o.orderDate]]>
</query>
<properties>
<property datatype="dateTime"
name="orderDate"/>
<property datatype="decimal"
name="sum"/>
</properties>
</valueCollectionDatasource>
</dsContext>
salesAggregatorDs is the dataSource of a SerialChart. I wanted to add items to the SerialChart from an query to Order table.
Furthermore, in screen controller sales.java, I have problem to @inject this Datasource:
The error is:
“Type parameter ‘com.haulmont.cuba.core.entity.KeyValueEntity’ is not within its bound; should implement 'com.haulmont.cuba.core.entity.Entity<java.lang.Object>”
Could you provide a sample demo project of how to use Value Datasources(especially used as a Datasource of a SerialChart), or direct me to the URL if you already have one?
However, it can not be recognized in XML declaration file (sales.xml) with
error “Element valueCollectionDatasource is not allowed here” shown in IntelliJ:
<dsContext>
<valueCollectionDatasource id="salesAggregatorDs">
<query>
<![CDATA[select o.orderDate, sum(o.amount) from posportal$Order o group by o.orderDate]]>
</query>
<properties>
<property datatype="dateTime" name="orderDate"></property>
<property datatype="decimal" name="sum"></property>
</properties>
</valueCollectionDatasource>
</dsContext>
salesAggregatorDs is the dataSource of a SerialChart. I wanted to add items to the SerialChart from
an query to Order table.
Furthermore, in screen controller sales.java, I have problem to @inject this Datasource:
The error is: “Type parameter ‘com.haulmont.cuba.core.entity.KeyValueEntity’ is not within its bound; should
implement 'com.haulmont.cuba.core.entity.Entity<java.lang.Object>”
Could you provide a sample demo project of how to use Value Datasources(especially used as a Datasource of
a SerialChart), or direct me to the URL if you already have one?
It is really great. I tried the demo you sent and it works flawlessly!
However when it is used in my project, I still can not get rid of the error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Compile error begin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
web:compileJava <path to project>\modules\web\src\cloud\pospro\posportal\web\screens\Sales.java:43: error: type argument KeyValueEntity is not within bounds of type-variable T
private CollectionDatasource<KeyValueEntity, Object> salesAggregatorDs;
^
where T,K are type-variables:
T extends Entity<K> declared in interface CollectionDatasource
K extends Object declared in interface CollectionDatasource
1 error
FAILED
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Compile error end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is where I @inject the Value Datasource salesAggregatorDs, which was declared in Sales.xml file.
My cuba studio (Registered):
Version 6.4.1
Looks like com.haulmont.cuba.core.entity.KeyValueEntity is inaccessible from web screen.