Think this example will help you http://en.wikibooks.org/wiki/Java_Persistence/ManyToMany
Is it possible to configure Hibernate to allow Multi use Values?
-
07-10-2022 - |
Question
i'd like to ask is the following shema is realizeable with Hibernate:
I have a Table called Dog and another one called Owner.
I can have one Owner for severeal dogs. On the Other side i can have severeal dogs for severeal User. It's a thing of perspective i think.
The goal would be to realize a hbm.xml Map which allow to get all owner from a dog and to get all dogs from severeal owner.
I need to programm a Function that support this. I hope u can follow my thoughts.
I even tried it and got a recursiv StackoverFlow because when i'm calling for a dog it will try to fill his owner. When the owner is called from a dog it try's to get all dog from the current owner and again again till my overflow.
If this is to complex i can make a cutomized Code.
Thanks, so far.
La solution