-->
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: Business and derived objects mapping
PostPosted: Mon Apr 26, 2004 4:20 am 
Newbie

Joined: Mon Apr 26, 2004 3:07 am
Posts: 1
Location: France
I have the following model :


class hibernateobject {
.....
}

class businessobject extends hibernateobject {
.....
}

class businessobjectSpecific extends businessobject {
.....
}


For the 3 classes, I need the 3 same mappings files (except for the class name, i set polymorphism=explicit).
I can't use the subclass clause because I don't have a discriminator and for our application we need the 3 classes.

Is there any way to specify the mapping or how can i tell to hibernate to use the same persister for the 3 classes ?

What about the performance issue by multiplying by 3 the numbers of mapping files (except at the start of Hibernate) ?

I specify one mapping file (the Hibernate Object one) and I modify the methods getPersister in SessionfactoryImpl (loop -> getSubclass). This work perfectly for session.save, session.load, but this solution is too ugly (Performance ?, specific hibernate version....)

Thanks,
Stephane


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 2:40 pm 
Newbie

Joined: Thu Apr 22, 2004 3:21 pm
Posts: 15
Will you ever be persisting a hibernateobject, or a businessobject? In this case usually only the businessobjectSpecific is the one that is persisted. The rest are the results of a good class diagram.

If this is not the case then I would recomend using the default discriminator.


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.