-->
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: Project arbitary properties into a Map?
PostPosted: Sun Apr 02, 2006 4:01 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:43 am
Posts: 48
Hibernate version: 3.1

Hello,

In my DAOs, i use Criteria and a ProjectionList of PropertyProjection objects to generate report queries. It works great and is quite flexible.

I use the query results to manually construct maps. Object arrays are not very friendly for the tiers upwards and custom DTOs have their own downsides, especially when projecting arbitary properties.

Anyway, is there a way in recent versions to project directly into a map containing the property names as keys to the returned values? I saw older similar posts but no solution.

Thanks,

Manos


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 02, 2006 4:20 pm 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:43 am
Posts: 48
Hm. I suppose i could write a ResultTransformer, but is there a way to avoid the need for aliases? How can i obtain the actual property names used and assign them as keys to the returned 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.