-->
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: multi level inheritance tree
PostPosted: Wed Nov 07, 2007 8:18 am 
Newbie

Joined: Tue Sep 23, 2003 7:02 am
Posts: 16
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Firstly I would like to thank anyone in advance for any help they might provide.

Mine is a simple question. I have been using Hibernate for at least two year and I have used its inheritance capability in many projects. I find myself wanting to implement a multi level interitence tree... for example

animal -> bird -> sparrow

However I can not find an example of how to implement this. In the past I have used joined-subclass and from the 3.0 dtd I can see that you can embedded joined-subclasses. However I have no idea what is the best way to handle the primary key, or in fact that I am barking up the worng tree all together.

Any help would be appreciated.

Thanks Lee


Top
 Profile  
 
 Post subject: Hibernate MultiLevel inheritance
PostPosted: Wed Nov 07, 2007 12:13 pm 
Beginner
Beginner

Joined: Tue Jun 26, 2007 2:31 pm
Posts: 21
Yes, the idea you have is right you can embed the <joined-subclass> again in a <joined-subclass> this will work for multi-level inheritance.

If you have a discriminator in your table then you can even go with <subclass> using discrimator-column and discriminator-value, this works.


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.