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
|