-->
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.  [ 5 posts ] 
Author Message
 Post subject: joined-subclass to define C extends B extends A relationship
PostPosted: Thu May 04, 2006 4:34 pm 
Newbie

Joined: Thu May 04, 2006 12:12 pm
Posts: 4
Hibernate Version : 3
Database: Sybase 12.5.1
WebLogic 8.1

Hi,

I have seen plenty of examples using the joined-class to define the B is a Subclass of A relationship.
What I would like to define in my mapping file is the C is a B is an A(or C extends B extends A). Am I right to assume I can use a joined-subclass within an another joined-subclass ?

Secondly, if each of my classes have a large number of properties, the mapping file could get quite large and more difficult to manage.
Is there a way to define the relationship but seperate the mapping files in to smaller ones.


Thanks in advance

Jadiyo


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 4:41 pm 
Regular
Regular

Joined: Wed Aug 25, 2004 6:23 am
Posts: 91
Yes, you can either nest the joined-subclasses or you can declare them separately and then use the extends attribute to link them together. If you do this they can even be in separate files all loaded into the same SessionFactory configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 4:44 pm 
Regular
Regular

Joined: Wed Aug 25, 2004 6:23 am
Posts: 91
See http://www.hibernate.org/hib_docs/v3/re ... ogrammatic for details on loading multiple files


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 05, 2006 7:28 am 
Newbie

Joined: Thu May 04, 2006 12:12 pm
Posts: 4
Thanks r1ch...very helpful.

So, if the definition of A is in its own mapping file and the joined-subclass B is defined in another (with extends A), this means mapping file for A no longer has any reference to B and Hibernate is clever enough to do the donkey work when it loads?

Thanks again

Jadiyo.


[/i]


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 05, 2006 7:32 am 
Regular
Regular

Joined: Wed Aug 25, 2004 6:23 am
Posts: 91
Yes - we're doing exactly that with our application. We have mapping files for various modules that get loaded via addResource in an unpredictable order at startup but as long as all of the dependencies are there by the time buildSessionFactory is called Hibernate manages to work it all out.


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