-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem joining legacy tables
PostPosted: Tue Jul 11, 2006 1:06 pm 
Newbie

Joined: Fri Apr 07, 2006 11:29 am
Posts: 17
I am using Hibernate 3, and attempting to use the <join> tag to join 2 legacy tables together. Unfortunately, the IDs for the tables are composites. Not a problem, Table 1 has a <composite-id> to do the query. This works fine.

Table 2 unfortunately names the columns differently from Table 1.
Here is an example of how the ID fields map.

TABLE.FIELD
Table1.fieldX
Table2.fieldX

TABLE.FIELD
Table1.fieldY
Table2.yField

As you can see, Table 2 does not have the same name for fieldY as Table 1.

Because the <join table="table2"> tag requires a <key> tag, containing <column name="..."> tags, I have included both fieldX and fieldY as columns.

Is it possible to join these tables?

I have already looked at http://blog.exadel.com/?p=16, which explains how to do this if Table 1's single key field matches the single key field in Table 2.

Thanks, Brad


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.