-->
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: Mapping issue with using different field for joins
PostPosted: Fri Dec 12, 2008 12:10 pm 
Newbie

Joined: Fri Dec 12, 2008 11:57 am
Posts: 1
I have a mapping that I use inside a Person class mapping:

Code:
        <set
            name="Participants"
            cascade="save-update"
            inverse="true">
            <key
                column="PersonId" />
            <one-to-many
                class="ISIS.Data.Core.Participant, ISIS.Data" />
        </set>


The participants table is an older table and hasn't been migrated to our new structure (for instance, in the new structure, the PersonID would be a Guid, but for the Participants tabe, it is an Int). All the other code uses the Guid PersonId, so that is what I have the Id for Person mapped to. I need to join the Person and Participants table, so I tried using the
Code:
foerign-key
and setting it to IntId (the old IntId in the Person class), but the join still comes up as

Code:
       INNER JOIN PARTICIPANT PARTICIPAN1_
         ON THIS_.ID = PARTICIPAN1_.PERSONID


THIS_.ID being the primary key of Person (the Guid), that I want to be the IntId. Can I do this? Or do I need to add these Guid's to the Participant table?

If you need any other info, I will do my best to supply it.


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.