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

Sandeep Vaid (JIRA) noreply at atlassian.com
Tue Jul 7 05:36:14 EDT 2009


<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.3.2, 3.3.1, 3.3.0.SP1, 3.3.0.GA, 3.3.0.CR2, 3.3.0.CR1, 3.2.7, 3.2.6
            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