I hope I can explain this problem clearly.
I have a class Foo which contains 2 objects of type Bar. I have two mapping files, one for Foo and one for Bar.
The database tables represent a Foo object, and a Bar object. The Foo db table has no reference to the Bars it owns. The Bar table has a FK reference to the Foo object they belong to.
Ideally, my Hibernate mapping file will be set up such that I save a Foo object, and it cascade saves/updates/deletes.
I am fairly new to Hibernate, and have researched different mapping options, but none seem to fit this scenario. Any advice is much appreciated, and I will remain available to answer any questions.
Thank you very much
|