I can understand relationships between entities (and classes) easily from a DDL or a UML diagram. But Hibernate confuses me totally. I've tried generating various DDL's but when I think I understand, I get stuck again.
Could someone explain how to realize the following in Hibernate mapping files? I'd like an explanation on these cases with and without bi-directionality as well.
I guess this is a lot to ask, but trying doesn't hurt... ;-)
Using UML notation:
Code:
CASE 1)
1 0..1
A ---------------------- B
CASE 2)
1 0..*
A ---------------------- B
CASE 3)
0..1 0..*
A ---------------------- B
CASE 4)
0..* 0..*
A ---------------------- B
CASE 5)
1 1
A ---------------------- B
I think that pretty much cover all the cases.