Hi
When I uses getHibernateTemplate.find("from order_items"); on the below mapping then it gives data from order_items, order_header both, party and all others tables that are linked with foreign key.
I wants data only from order_items only, Is there any possible way to do this. I have tried using select clause but that gives me object array of columns in list while without select clause I m getting hashmap in list.
So using select I have to create hashmap myself. So if any alternative exists then please let me know.
My mapping is as below:
<class entity-name = "order_header" >
<id name = "transferId" type = "string" length = "20" column = "transfer_id">
<generator class = "assigned"/>
</id>
<property name = "transferDate" type = "date" column = "transfer_date"/>
<property name = "transferDateTime" type = "date" column = "transfer_date_time"/>
<property name = "requestedQty" type = "long" length="20" column = "requested_qty"/>
<property name = "transferValue" type = "long" column = "transfer_value"/>
<property name = "errorCode" type = "string" length="40" column = "error_code"/>
</class>
<class entity-name = "order_items">
<composite-id >
<key-many-to-one name="transferId" entity-name="order_header" column="transfer_id" lazy="false"></key-many-to-one>
<key-many-to-one name="partyId" entity-name="party" column="party_id" lazy="false"></key-many-to-one>
<key-many-to-one name="userType" entity-name="enumeration" column="user_type" lazy="false"></key-many-to-one>
<key-property name="productCode" column="product_code" type="string" length="10"></key-property>
</composite-id>
<property name = "accessType" column="access_type" type="string" length="10"/>
<property name = "partyAccessId" type = "string" column = "party_access_id"/>
<property name = "geoId" type = "string" length="20" column = "geo_id"/>
<property name = "accountId" type = "string" length="20" column = "account_id"/>
<property name = "entryType" type = "string" length="5" column = "entry_type"/>
</class>
Thanks in advance
_________________ Jini
|