Product and ProductBasic has one-to-one relationship
Product ---> ProductID <<PK>>
ProductBasic ----> ProductId, useCode, StartTime as composite key.....
this startTime's value will be known as runtime.
Now i want to define mapping between Product & ProductBasic, how will i do it ?
Moreover suppose i define their mapping as product.product ID = productBasic.pr oductID and useCode='a' as :
Product.hbm.xml :
<one-to-one name="productBa sic" class="ProductB asic" cascade="save-update" property-ref="activeProd uct" lazy="proxy" constrained="tr ue">
<formula>'008 '</formula>
<formula>PRODUC TID</formula>
</one-to-one>
ProductBasic.hb m.xml as :
<properties name="activePro duct">
<property name="useCode" column="USECODE "></property>
<many-to-one name="productBO " class="ProductB O" column="PRODUCT ID" insert="false" update="false"/>
</properties>
How can i specify startTime value at runtime (say in eager fetching)? I can't use "inner join fetch" along "with clause".. ?
Or i want to specify a condition in fetch join that startTime<curre ntTime<endtime. the value of currenttime will be known
at runtime...How to make this work?
Product ---> ProductID <<PK>>
ProductBasic ----> ProductId, useCode, StartTime as composite key.....
this startTime's value will be known as runtime.
Now i want to define mapping between Product & ProductBasic, how will i do it ?
Moreover suppose i define their mapping as product.product ID = productBasic.pr oductID and useCode='a' as :
Product.hbm.xml :
<one-to-one name="productBa sic" class="ProductB asic" cascade="save-update" property-ref="activeProd uct" lazy="proxy" constrained="tr ue">
<formula>'008 '</formula>
<formula>PRODUC TID</formula>
</one-to-one>
ProductBasic.hb m.xml as :
<properties name="activePro duct">
<property name="useCode" column="USECODE "></property>
<many-to-one name="productBO " class="ProductB O" column="PRODUCT ID" insert="false" update="false"/>
</properties>
How can i specify startTime value at runtime (say in eager fetching)? I can't use "inner join fetch" along "with clause".. ?
Or i want to specify a condition in fetch join that startTime<curre ntTime<endtime. the value of currenttime will be known
at runtime...How to make this work?