-->
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: Composite Key mapping - can't figure this out...
PostPosted: Thu Nov 17, 2005 9:28 am 
Beginner
Beginner

Joined: Sat Apr 17, 2004 1:11 am
Posts: 36
I have the following:

Code:
DbCredential:
  PK:CredentialKey

DbCredentialLocation:
  CK:
    CredentialKey:FK to DbCredential
    Location


and I'm trying to map it as follows:

Code:
<class name="BOM.DbCredential, BOM" table="DbCredential">
    <id name="CredentialKey" type="String" column="CredentialKey">
      <generator class="assigned" />
    </id>
    <one-to-one name="DbCredentialLocation" class="BOM.DbCredentialLocation, BOM"/>
  </class>

  <class name="TrackIt.BOM.DbCredentialLocation, BOM" table="DbCredentialLocation">
    <composite-id>
      <key-many-to-one name="CredentialKey" class="TrackIt.BOM.DbCredential, BOM" column="CredentialKey"/>
      <key-property name="Location" type="String" column="LOCATION" />
    </composite-id>
  </class>


This mapping gives me the old:

Code:
broken column mapping for: DbCredentialLocation.id of: TrackIt.BOM.DbCredential


I think this is because I'm trying to declare a one-to-one between DbCredential and DbCredentialLocation with one class have a single PK and the other end having the composite key. The db structure here is desirable but I cannot figure out how to map it...

Any help would be greatly appreciated...

benster


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.