-->
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: Newbie: Table joins
PostPosted: Thu Jan 12, 2006 12:45 pm 
Newbie

Joined: Fri Jan 06, 2006 12:23 pm
Posts: 11
Hi,

I have one question, based on what I have read, because I don't undestand very well how to do that.

If I have a two tables, and in sql I would make a join with those tables, but, using nhibernate.
Should I make an string containg that join or there's another way to do that?, I don't know, using Criteria or other method.


'Cause, what I did until now, I load an object that has a list of other objects, that then I bind that with a DataGrid. But doing that, I can't see all the cells at one, undestand what I mean?
I have to click on every register, to the see the columns of the other table.

But, what if I want to show all the columns at once? Like if I were doing a join in sql?

Undestarnd what I mean?


Thanks a lot !!!


Top
 Profile  
 
 Post subject: Table Joins
PostPosted: Mon Jan 16, 2006 3:31 am 
Newbie

Joined: Wed Jan 11, 2006 5:21 am
Posts: 14
What I would suggest is you download the hibernate reference document from hibernate.org.

Look for <set> or <bag> or <list> mapping.
Normally you'll find the mapping definition to a collection. Just add the attribute setting fetch="join". This will make any of your calls to query() or load() method of Session object retrieve all the related collection records based on your table POJO mappings.

Kind regards,
roy
Please dont forget to give credit if I answered your inquiry.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 9:16 am 
Newbie

Joined: Fri Jan 06, 2006 12:23 pm
Posts: 11
I'll try that.

Thanks.


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.