-->
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.  [ 8 posts ] 
Author Message
 Post subject: Inheritance-mapping (10.1.3) Question
PostPosted: Tue Jul 12, 2005 8:23 pm 
Beginner
Beginner

Joined: Wed Jan 19, 2005 6:07 am
Posts: 20
When I first tried out the mapping-guide for subclasses in separate tables with discriminator got strange results when just 'copying' the code from the sample. It seems that the sample is incomplete regarding to the key-attribute and so on.

Another thing when I got that right, it also seemed that the parent-class could very easy be an interface, but the subclass could only be an concrete implementation.

How can I then define inheritance in two levels ?

My inheritance-tree starts off with an top-level interface (actually two, one for DAO and one for business), and the next level is a new set of 'duplicate' interfaces before I land down on concrete implementations.

I wanted to use a strategy where I used 'one table per subclass using discriminator' for the first level of inheritance, and using 'one table per class hierachy using discriminators' for the lowest level. Thus ending up with n+1 (n = number of subclasses in the first level) tables and discriminator-columns in all of them.

As I read the HIA, and try out a few things, I begin to wonder if this is at all possible to achieve.

Is it possible?, and if ; why is it not mentioned in the otherwise excellent book ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 13, 2005 1:42 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Since your questions are vague and you don't tell what actually is wrong with your code, please use the regular user forum and don't forget to read: http://www.hibernate.org/ForumMailingli ... AskForHelp


Top
 Profile  
 
 Post subject: Dont't really relate my Q to my own attempts.
PostPosted: Wed Jul 13, 2005 3:03 am 
Beginner
Beginner

Joined: Wed Jan 19, 2005 6:07 am
Posts: 20
Whar I really just wanted to know is;

Is it possible to map inheritance over more than one level ?

(Parent-child-grandchild...) ?

In my previous Q, I also attempted to describe which strategies I wanted to use in the two parent-child relations (table pr subclass between parent-child, and table per hierachi for child-grandchild).

I can't see anything in the HAI-book to support this, and not in the regular docs either.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 13, 2005 3:27 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Of course, just nest <subclass>, <joined-subclass>, or put them in separate mapping files with an extends="" attribute.

http://www.hibernate.org/hib_docs/v3/re ... n-subclass

http://www.hibernate.org/hib_docs/v3/re ... edsubclass

http://www.hibernate.org/hib_docs/v3/re ... onsubclass

Please use the regular user forum now if you don't have questions about the book. Note that all of this is explained in the HiA as well, so you might want to reread.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 6:15 am 
christian wrote:
or put them in separate mapping files with an extends="" attribute.


could you please extend the documentation with this attribute and an example for the use of this attribute?

r.


Top
  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 6:38 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
It's already there...

http://www.hibernate.org/hib_docs/v3/re ... n-subclass


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 6:41 am 
ok, but the declaration definition is missing this attribute...


Top
  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 6:47 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Already fixed in CVS...


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