-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Select data using getHibernateTemplate.find()
PostPosted: Thu Apr 12, 2007 12:27 am 
Newbie

Joined: Thu Mar 29, 2007 7:03 am
Posts: 9
Location: Delhi
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.