-->
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: Is there something like select new for returnign a map of va
PostPosted: Tue Nov 21, 2006 9:38 pm 
Regular
Regular

Joined: Thu Jul 29, 2004 11:55 pm
Posts: 75
I was wondering if there is anything built into hibernate to return a query and specific a key/value and have a map returned similar to creating an obejct with select new? Is my only option to create a *transformer* for the results and populate my own map (which I think I have done in the past).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 22, 2006 2:18 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
The following is an example from Hibernate reference doc: -

Code:
select new map( max(bodyWeight) as max, min(bodyWeight) as min, count(*) as n )
from Cat cat


"This query returns a Map from aliases to selected values. "


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.