Hello. I have some question regarding the mapping please.
Currenly I am migrating my project from using TopLink to Hibernate. In all of my table, there is a column named "LAST_CHNG_DTTM" which is used as timestamp column for optimistic lock checking. This column is mapped to "modifyTime" property of Aufir domain object which is mapped using component mapping with all other domain object.
My question is how can I mapped this timestamp column. Currently it seem that <timestamp> element is not support within <component> elelment. If current Hibernate does not support this kind of mapping, is there any suggestion? If possible, I do not want to change my existing domain objects.
Following is the example of my mapping. I want to change the mapping of "modifyTime" property from <property> to <timestamp>
Code:
<hibernate-mapping package="com.pws.ubiquity.common.domain"
default-access="field">
<class name="CommonConstraintGroup" table="CO_SYST_CSGP">
<id name="code" column="CO_SYST_CSGP">
<generator class="assigned" />
</id>
<property name="description" column="CSGP_DESC" />
<property name="dataType" column="CSGP_DATA_TYPE" />
<property name="maxLength" column="MAX_CODE_LNTH" />
<property name="owner" column="OWNR_FLAG" />
<property name="label" column="CSGP_LABL" />
<component name="audit" class="Audit">
<property name="createdBy" column="CRTD_BY" />
<property name="createTime" column="CRTD_DTTM" />
<property name="modifiedBy" column="LAST_CHNG_BY" />
<property name="modifyTime" column="LAST_CHNG_DTTM" />
</component>
</class>
</hibernate-mapping>
Thank you very much in advanced.
Best regards,