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