-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate rel tables.
PostPosted: Wed Aug 02, 2006 10:56 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hi,
I am new to hibernate.
I have just noticed that if I make 1:M rel unidirectional or bidirectional, hibernate uses different table mapping stradegies.
Why I don't know?

If the 1:M rel is bidirectional, a foreign key is employed on the 1 side. This is standard O / R mapping.
However if, the same rel is made unidirectional, so you can
only go from the 1 side to the Many side in Java code, hibernate employs an extra rel table to store the rel mappings, similar to a standard M:M rel table.

I thought the unidirectional / bidirectional were more Java concepts, for the object model. i.e. just because something is unidirectional in my Java class, I don't see why that means why standard foreign keys are not employed.

Why does hibernate do this?

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.