I have an legacy JPA-modell with a lot of eager loading associations, which makes some queries quite slow. For displaying only a couple values in a grid I'm trying to fetch only certain fields from an entity. I built a custom namedquery which fetches only a subset of all fields and it would be nice to "map" this query to the "standard" fetch operation (see .ds.xml). I found a sample in the docs (http://www.smartclient.com/smartgwte...tml#namedQuery) which works with a custom operation type.
Can I somehow make smartgwt call the namedQuery for the default fetch-operation instead of building a select * from Entity query? Or is there another way of ommiting some fields from the database query?
Thank you
Code:
<DataSource
ID="KONTAKT_GRID"
serverType="jpa"
beanClassName="com.mycompany.server.custom.entity.kontakt.Kontakt"
dropExtraFields="true"
>
<fields>
<field name="id" type="integer" primaryKey="true" hidden="true"/>
<field name="name" type="string"/>
<field name="vorname" type="string"/>
<field name="aktiv" type="boolean"/>
</fields>
<operationBindings>
<operationBinding operationType="fetch" namedQuery="Kontakt.aktiv.lookup"/>
</operationBindings>
</DataSource>
Thank you
Comment