[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4024) <join>: <key>: different composite key

Sandeep Vaid (JIRA) noreply at atlassian.com
Tue Jul 7 06:43:12 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33548#action_33548 ] 

Sandeep Vaid commented on HHH-4024:
-----------------------------------

<class name="BondBO" table="TBINVESTMENTPERIOD" optimistic-lock="version" > 
 should be 
<class name="BondBO" table="BOND" optimistic-lock="version" > 

> <join>: <key>: different composite key
> --------------------------------------
>
>                 Key: HHH-4024
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4024
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.2.6, 3.2.7, 3.3.0.CR1, 3.3.0.CR2, 3.3.0.GA, 3.3.0.SP1, 3.3.1, 3.3.2
>            Reporter: Sandeep Vaid
>            Priority: Critical
>
>  Presently hibernate doesn't support this..
>  
>  I have Bond domain class which maps to 2 tables viz. BOND nad BONDBASIC. The composite-key of both these tables are different.
>  
>  BOND -----> INVESTMENTID, USECODE, STARTTIME (as composite-key)
>  BONDBASIC ----> INVESTMENTID, INVESTMENTID2, STARTTIME, TYPE (as composite-key)
>  
>  NOTE: This is a legacy database, which i cannot change..
>  
>  In bond.hbm.xml:
>  
>  <class name="BondBO" table="TBINVESTMENTPERIOD" optimistic-lock="version" >
>    <composite-id name="compBondBO" class="CompBondBO"> 
>     <key-property name="investmentId" column="INVESTMENTID"/>
>     <key-property name="useCode" column="USECODE"/>
>     <key-property name="startTime" column="STARTTIME"/>
>    </composite-id>
>    
>    <version unsaved-value="undefined" name="version" column="VERSION" type="com.tietoenator.lis.common.db.Db2Timestamp" />
>    
>    <join table="BONDBASIC">
>     <key> 
>       <!-- <column name="INVESTMENTID"></column>-->
>       <!-- <column name="STARTTIMESTAMP"></column>-->
>      </key>
>     </join>
> </class>	 
>   How to specify the FK and PK of BONDBASIC ? 
>   Hibernate doesn't provide any way to specify this kind of mapping..

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list