-->
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.  [ 4 posts ] 
Author Message
 Post subject: Inheritance
PostPosted: Wed Sep 03, 2003 9:00 am 
Newbie

Joined: Wed Sep 03, 2003 8:55 am
Posts: 7
I'm a bit confused after reading the available documentation for Hibernate; it seems that the only way to declare subclasses is using either subclass or joined-subclass elements inside root class declaration.. However, in the project I'm currently working on we have like 50-100 subclasses all extending a singe base class for business objects - this would result into extremely cumbersome base class declaration.

So I was wondering whether there exists some other way of defining inheritance - preferably by something like:

Code:
<class name="SubClass" extends="BaseClass"...


Thanks in advance.. :)[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2003 9:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Max added this to Hibernate 2.1. Not sure if he documented it yet.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2003 9:10 am 
Newbie

Joined: Wed Sep 03, 2003 8:55 am
Posts: 7
Ok.. Can you give me some pointers to where to look at - I think I could dig it out from sources?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2003 9:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
shoka wrote:
Ok.. Can you give me some pointers to where to look at - I think I could dig it out from sources?


Get the newest version and you should be able to just to add <subclass> and <joined-subclass> directly.

They should just have an extends="superclass-name" attribute.

And remember that you load the superclass mappings BEFORE the subclasses - otherwise hibernate will complain!

_________________
Max
Don't forget to rate


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