-->
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: Mapping one class on several tables
PostPosted: Mon Aug 15, 2005 8:23 am 
Newbie

Joined: Mon Aug 15, 2005 8:03 am
Posts: 14
Location: Germany
hello everybody,

we are going to map instances of an object (depends on the value of an attribute) on several tables.

Is this possible (without subclassing), or we have to extend this class in several subclasses and then map any subclass using discriminator?

Ifn the case of possiblity without extending the class, how can we do it?

We are using hibernate 3.0.5 .


Thanks in advance,
Reza


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 15, 2005 8:26 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
I'm not sure if it's possible but I am fascinated by why you would want to do this. Why? Why would you ever need to map a single object to multiple tables based on the value of an attribute unless the class was a good candidate for subclassing using a discriminator?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 15, 2005 9:10 am 
Newbie

Joined: Mon Aug 15, 2005 7:42 am
Posts: 10
Hello Jamie,

the reason is that we have an existing database model which we must not change on one hand and we have identical functionality for each of these tables on the other hand.

Currently, the functionality is duplicated for each table. Since we currently implement the functionality on a new platform (Spring with either Hibernate or iBatis), we don't want to keep this "historic" design flaws in our new business logic and expect the persistence tier to be able to map the domain object to database tables, even if it is not trivial like in this case ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 15, 2005 9:12 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Post only in ONE FORUM.


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.