-->
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.  [ 3 posts ] 
Author Message
 Post subject: How do I map this? (Difficult scenario for legacy system)
PostPosted: Mon Oct 24, 2005 4:09 am 
Newbie

Joined: Tue Jun 08, 2004 12:04 am
Posts: 12
Hi all,

I recently ran into a difficult mapping scenario in a legacy database. Appreciate if any guru out there that can help.

Table A
---------
PrimaryKey1
LogicalKey_B
LogicalKey_C
DataField_A1

Table B
---------
PrimaryKey_B
LogicalKey_B
DataField_B1

Table C
---------
PrimaryKey_C
LogicalKey_C
DataField_C1

Now, if A.LogicalKey_B is the key field to be used to join with B.LogicalKey_B, how would I map that?

With native SQL, the statement should be like:
select * from A, B, C
where A.LogicalKey_B = B.LogicalKey_B
and A.LogicalKey_C = C.LogicalKey_C

This is what I did and I think it didn't got it right:
In the mapping document for A, I use

<set name="x" table="A">
<key column="LogicalKey_B"/>
<many-to-many class="B" column="LogicalKey_B"/>
</set>

Anyone that is good can help in this?

Many thanks!
-RS


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 11:28 pm 
Newbie

Joined: Tue Jun 08, 2004 12:04 am
Posts: 12
Hmm....Really nobody knows?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 6:00 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
what is logical key ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.