-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to map an interface
PostPosted: Wed Nov 26, 2003 8:29 am 
Newbie

Joined: Thu Nov 13, 2003 6:09 am
Posts: 7
Hallo,

I've got the following object model

interface SellableItem;
=>Set orderLines

class Product implements SellableItem;
class ServiceContract implements SellableItem;

class OrderLine;
=>SellableItem item;

The relationship between SellableItem and OrderLine should be a bidirectional 1:n relationship.

I've tried to map this but I always get an error using the ExportTool:
Error: net.sf.hibernate.MappingException: Association references unmapped class: demo.myshop.model.hibernate.SellableItem

I hope someone can help me with this mapping.

Thanks,

Stephan


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 10:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You need to map concrete classes (which may have interfaces) since they must be instanciated. In your case you will also want to look into polymorphic mapping strategies. See documentation at http://www.hibernate.org/hib_docs/reference/html/or-mapping.html#or-mapping-s1-11


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 10:24 am 
Newbie

Joined: Thu Nov 13, 2003 6:09 am
Posts: 7
Thanks for your quick answer.

I hope I understand you right, you say I have to do it via inheritence ?

Thanks,
Stephan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.