-->
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 and mapping files
PostPosted: Wed Aug 17, 2005 3:08 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
In table per sub-class implementation, is it possible to list the joined-subclass in separate mapping files ( which I am thinking for sure is not possible with current implementation )? I have a base class which is extended by many classes, and I don't want to put all those joined subclass xml definitions in one mapping file. That would make it monolithic. Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:10 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:12 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Yes, there is no problem listing them in separate mapping files. The DTD shows this.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:21 pm 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
I think that you can't separate the definitions. But I have an ideia.
You can create the subclasses without any atribute. In each subclass you create an association with another class with the atributues.

For example:

Animal have subclasses Cat and Dog. But Can and Dog have several atributes. So, you create CatDescription and DogDescription and put the atributes in the Description classes. In this case, you can map DescriptionCat and DescriptionDog to separate classes.
When you need to send a message to Cat, you do: cat.getDescription().sendMessage();


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.