Hibernate 3.0
I am involved in a project where the database, tables are already created. The tables I am dealing with currently include simple joins between two or three tables to gather data. I cannot change this fact.
Since I have existing data, which approach do I use? I have read and cannot figure this out:
Table per concrete class?
Table per class hierarchy?
Table per subclass?
So let say table per subclass. If I am joining on two tables. Lets say foo and baz. Where foo.id is a primary key and baz.id is the foreign key.
When I create my mappings, do I create two mappings? I cannot seem to find examples of this type of join.
Then if I create two mappings, and two classes to hold the data in, then do I issue a hql query that joins the tables?
If someone could give me some starter points here, I would certainly appreciate.
|