We can just take an example. In the following mapping if the col1 filed is of int type and its an optional field, Hibernate will set its default value as an integer's default value, i.e. 0. But in database I want to set it as NULL. How can I achieve this specific requirement?
Code:
<hibernate-mapping>
<class name="com.ibm.wdp.bss.party.entity.AddressBean"
table="tab1">
<id name="id" type="long" column="Id">
<generator class="increment" />
</id>
<property name="col1" type="int" column="COL"/>
</class>
</hibernate-mapping>