We have a table with following columns in composite key:
1. AddDate
2. UserId
3. Password
Below is our mapping file:
Code:
<hibernate-mapping package="com.test.model">
<class name="UsedUserPassword" table="UsedUserPassword" >
<composite-id>
<key-property name="addDate" type="timestamp" >
<column name="AddDate" length="23" />
</key-property>
<key-property name="userId" type="int">
<column name="UserID" />
</key-property>
<key-property name="password" type="string">
<column name="Password" length="50" />
</key-property>
</composite-id>
</class>
</hibernate-mapping>
Thus, all three columns are composite key. We are using MS-SQL DB, Hibernate 3 and want to use database default value of getdate() for AddDate column. However, there is no way to say insert="false" on AddDate column in mapping file. Please help!