-->
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: Legacy code mapping using subclass-join
PostPosted: Fri May 26, 2006 12:04 pm 
Newbie

Joined: Wed Oct 06, 2004 2:49 am
Posts: 12
On my current project I have to map old -badly designed- legacy tables. I want to use the subclass-join map pattern, but I have the following problem:

The parent class has a column contaning the table-name that contains additional child information (the ideal candidate for the discriminator value-currently there are 5 different child tables). The child class has no reference to the parent class, but the parent has a additional column containing the primary key to the child table (which is not really a foreign key for the database because the exact table holding the key is defined by the discriminator). Basically what I need is the ability to define the column of the parent table that will be used to join with the child table (Hibernate uses the pk of the parent table and it seems that this can not be configured). I know I can define the key of the child table table that is used for the join using <key> in the <join> element, but that is not enough for this rare case where a different column as the pk in the parent table is the reference to the child table. Also I can't make the association many-to-one because I don't know the child table (Or is there a many-to-one/discriminator functionality that I don't know of). Any help is appreciated.

Rgds,
Okke Harsta


Last edited by oharsta on Fri May 26, 2006 4:32 pm, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: Legacy code mapping
PostPosted: Fri May 26, 2006 4:21 pm 
Newbie

Joined: Wed Oct 06, 2004 2:49 am
Posts: 12
Corrected grammar mistakes, but not the problem!


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.