-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping with interfaces
PostPosted: Fri Mar 06, 2009 6:38 am 
Newbie

Joined: Fri Mar 06, 2009 6:06 am
Posts: 1
I have two entities, Phone and Model. A Model is a cell phone model (eg BlackBerry Curve), and a Phone is a carrier model (Verizon BlackBerry Curve).

I want them both to contain pricing data (a PriceData entity).
I'm thinking they should both implements a Priceable interface that defines methods to get data necessary for price research. I'm not quite sure though. Phone and Model do not inherit from each other though, and I want to keep it that way if possible.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 06, 2009 7:50 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
You can probably use a Table per subclass aka joined-subclass strategy. So both Phone and model will inherit from Priceable interface but they wont have any inheritance b/w each other.

Also the tables for Phone and Model remains different.

_________________
Regards,
Litty Preeth


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

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.