Hi,
I am new to hibernate, forgive me if my question is too general to ask. I have gone through the documentation and could not find any solution. I want to map following Object Model to Data model:
Object Model
------------
public class Customer
{
String customerId;
Address generalContactInfo;
Address tradingContactInfo;
Other properties...
}
public class ContactInfo
{
String id;
String type;
Other properties...
}
Data Model is:
customer{customer_id, name, more columns....) PK: customer_id
contact_info(id, type, customer_id, more colums....) PK: id, FK: customer_id
The relationship between Customer and ContactInfo is one to many.
Few of my questions are:
1. Is it possible two properties of same type (genralContactInfo and tradingContactInfo of ContactInfo type) to a single table?
2. Do I need to extend ContctInfo base class to specialized class and use inherentance?
I shall be thankful for suggestions, documentation links.
Regards,
Raj Saini
|