-->
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.  [ 4 posts ] 
Author Message
 Post subject: Namedquery result in a Map
PostPosted: Tue Apr 17, 2007 8:44 am 
Newbie

Joined: Tue Apr 17, 2007 8:36 am
Posts: 2
How do I to get the Namedquery result in a Map?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 8:54 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
This what you're looking for?

query.setResultTransformer(ALIAS_TO_ENTITY_MAP)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 9:16 am 
Newbie

Joined: Tue Apr 17, 2007 8:36 am
Posts: 2
I need to execute a namedquery and get the result into a map setting one of the fields with a map key.
Is It possible to do this with hibernate or I need to implement this in Java?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 9:56 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
I would implement your own ResultTransformer. Look at the code for AliasToBeanResultTransformer, it looks like it would be a good starting point for what you want to accomplish.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.