[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3844?page=c...
]
Sandeep Vaid commented on HHH-3844:
-----------------------------------
If i don't use seperate class for composite-id, then it is working fine :
<class name="ProductBasic" table="PRODUCTBASIC"
optimistic-lock="version">
<composite-id >
<key-property name="productId" column="PRODUCTID"
type="com.tietoenator.lis.common.db.data.DbTrimmedStringValue"></key-property>
<key-property name="useType" column="USETYPE"
type="com.tietoenator.lis.common.db.data.DbTrimmedStringValue"
length="3"></key-property>
<key-property name="startTimeStamp" column="STARTTIMESTAMP"
type="com.tietoenator.lis.common.db.Db2Timestamp"></key-property>
</composite-id>
<properties name="activeProduct">
<property name="useType" column="USETYPE"
type="com.tietoenator.lis.common.db.data.DbTrimmedStringValue"
insert="false" update="false"></property>
<property name="endTimeStamp" column="ENDTIMESTAMP"
type="com.tietoenator.lis.common.db.Db2Timestamp"></property>
<many-to-one name="productBO" class="ProductBO"
column="PRODUCTID" insert="false" update="false"/>
</properties>
Mapping Associations using composite-key element ,property-ref
attribute and <formula> element
----------------------------------------------------------------------------------------------
Key: HHH-3844
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3844
Project: Hibernate Core
Issue Type: Improvement
Components: core
Environment: Hibernate 3.2.6.ga
Reporter: Sandeep Vaid
I want, join should be performed on 3 properties out of which 2 are normal properties and
one is part of composite key.
How can i specify these 3 properties inside <properties> tag ?
<class name="Product" table="PRODUCT"
optimistic-lock="version">
<id name="productId" column="PRODUCTID">
<generator class="assigned" />
</id>
<one-to-one name="productBasic" class="ProductBasic"
cascade="save-update" property-ref="activeProduct">
<formula>'001'</formula>
<formula>TIMESTAMP ('9999-12-31 00:00:00.0')</formula>
<formula>PRODUCTID</formula>
</one-to-one>
</class>
<class name="ProductBasic" table="PRODUCTBASIC"
optimistic-lock="version">
<composite-id name="compProductBasicBO"
class="com.tietoenator.lis.db.impl.product.bo.CompProductBasicBO">
<key-property name="productId" column="PRODUCTID"
></key-property>
<key-property name="useType" column="USETYPE"
></key-property>
<key-property name="startTimeStamp" column="STARTTIMESTAMP"
></key-property>
</composite-id>
<properties name="activeProduct">
<!-- <property name="compProductBasicBO.useType"
column="USETYPE" ></property> -->
<property name="endTimeStamp" column="ENDTIMESTAMP"
></property>
<many-to-one name="productBO" class="ProductBO"
column="PRODUCTID" insert="false" update="false"/>
</properties>
</class>
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira