How to configure the SmartClient DataSource with serverType Hibernate to select only the required fields?

StackOverflow https://stackoverflow.com/questions/12958495

  •  08-07-2021
  •  | 
  •  

I'm working with SmartClient release 8.3.

I configured this DataSource:

    <DataSource ID="example"
                serverType="hibernate"
                dropExtraFields="true"
                beanClassName="com.msp.dao.entities.Status">
        <fields>
            <field name="id"/>
            <field name="name"/>
        </fields>
    </DataSource>

and I'm using ListGrid to view the results.

For some reason the HQL query that is being generated select the entire entity instead of the selected fields.

This is the generated HQL Query: select _status from com.msp.dao.entities.Status _status
I want it to be generated like that: select _status.id, _status.name from com.msp.dao.entities.Status _status

Thank you

有帮助吗?

解决方案

You should use OperationBinding.outputs. But only from release 9 they will support it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top