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">…
Show thread
Presently there is no way in hibernate using which we can specify one-to-one relationship with property-ref to part of composite-id
of another entity. The following scenario will clarify the above statement.
There is a one-to-one relationship between Product and ProductBasic.
Product -----> productId (PK)
ProductBasic ----> pId, useCode, StartTime (as composite key) and pId is also foreign key referencing Product.
This is a legacy database. We get one-to-one relationship by using the …
Show thread