-->
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: select new map() vs select new CustomRow()?
PostPosted: Thu Jun 01, 2006 11:55 am 
Beginner
Beginner

Joined: Mon Sep 22, 2003 5:18 am
Posts: 28
Hi,
It is possible to query data into maps or custom value objects with use of HQL, to return only subset of information rather than to load whole entity(ies).

I wonder, if I use 'select new map(..)' - does it really slower than 'select new SomeValueObject(...)' ? With use of maps I have flexibility in returing dynamic number of fields, while with custom value object, i will be limited with properties defined there and for every new subset of them i will need to create correspondent constructure with parameters.

Did anyway profile both types of queries ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 3:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
they both work the same. the only diff is one instantiates a map and put stuff in it the other one instantiates a pojo and put stuff in that.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 5:26 pm 
Beginner
Beginner

Joined: Mon Sep 22, 2003 5:18 am
Posts: 28
I was wondering if some better perfomance can be gained from use of POJO, since in this case all Hibernate need to do is to call Constructor(param1, param2, etc.) rather than iteration thru each column and call map.out("field1", field1)
If it is not sagnificant,than it makes sense to keep using maps as more flexiable solution


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 5:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
test it for your usage scenario. too many factors to say for sure.

_________________
Max
Don't forget to rate


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.