-->
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.  [ 2 posts ] 
Author Message
 Post subject: Retriving Custom Query Result
PostPosted: Mon Jun 22, 2009 5:29 am 
Newbie

Joined: Thu Feb 22, 2007 6:42 am
Posts: 9
I have a bean named Offer. Which has been mapped on offer table. There are say 10 columns which are mapped on bean, accordingly.

Now, I have a query which is to be run on Offer table

Code:
select offer.COUNTRY_ID , sum(sortorder)
from offer
group by COUNTRY_ID


This will return a resultset with 2 columns only, which are definitely not mapped on Offer Bean. Now, my question is what should be the best practice to retrieve data from the result and return? Hibernate will return raw objects or what?


Top
 Profile  
 
 Post subject: Re: Retriving Custom Query Result
PostPosted: Mon Jun 22, 2009 9:03 am 
Regular
Regular

Joined: Wed Jun 20, 2007 1:53 am
Posts: 75
hibernate will retrun array of objects for the your query, and then you populate it, object[0] contains country_id and object[1] conatins sum(sortorder) ...


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

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.