Hi
We have two tables "Company" and "Person" as follows:
Company
[
CompanyId int PK
Name varchar
]
Person
[
PersonId int PK
FirstName varchar
LastName varchar
Type varchar
TypeId int
]
If Person.Type ="Company", then the Person details are for the Company whose Id is the value of Person.TypeId
This way a child table (Person) can have multiple parents based on the values of Type and TypeId.
Is there a way to achieve this in hibernate. We are using hibernate3.2, MySQL5, Java1.6 and Tomcat6.
Thank you for your help in advance
Regards
Sri
Last edited by sridharrajup on Thu Jun 12, 2008 9:55 am, edited 1 time in total.
|