-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping of multiple properties of same type
PostPosted: Mon Mar 28, 2005 2:42 am 
Newbie

Joined: Sun Mar 27, 2005 12:49 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.