-->
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.  [ 3 posts ] 
Author Message
 Post subject: Setting ResultSet to a single Object
PostPosted: Tue Jul 25, 2006 9:06 am 
Newbie

Joined: Tue Jul 25, 2006 8:50 am
Posts: 8
I am trying to retrieve some fields from multiple tables(i.e. multiple objects) and want to set that ResultSet into a single object by using hibernate.
e.g.
(select a.x,b.y from AVO a,BVO b where a.z = b.z and a.m = 12;)

i want to get a.x,b.y in form of an object.

How can i do it?????

_________________
mks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 25, 2006 10:28 am 
Senior
Senior

Joined: Sun Jun 04, 2006 1:58 am
Posts: 136
create a new DTO class and do

select new MyDto( a.x,b.y) from AVO a,BVO b where a.z = b.z and a.m = 12;

obiviously MyDto should have that constructor

_________________
Don't forget to rate


Top
 Profile  
 
 Post subject: thanx a lot
PostPosted: Wed Jul 26, 2006 1:22 am 
Newbie

Joined: Tue Jul 25, 2006 8:50 am
Posts: 8
Hi scarface,

Thanx a lot.This is working fine.....

_________________
mks


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