I have a legacy application running on Oracle 8.
Because Oracle 8 lacks of a proper Timestamp column type, we are using two columns for optimistic locking:
UPD_DTTS date // Date to seconds
UPD_DTMS number(3,0) // Milliseconds
I haven't found any explicit examples of this in the hibernate docs, but in digging around a bit I found that I could probably implement a CompositeUserType that implements the VersionType interface.
My confusion comes from not knowing how to specify, in my mapping file, that I want this type to be used by Hibernate for optimistic locking control.
According to the hibernate-3.0.dtd (if I'm reading it right) the only valid type for the version element is "integer". Or is that simply the default?
In any case, would the following be valid?
<class name="User" table="users" optimistic-lock="version">
<property name="username" column="USERNAME"/>
<property name="password" column="PASSWORD"/>
<version name="timestamp" type="myCustomCompositeTimestamp"></version>
</class>
Am I on the right track here?
Any help would be much appreciated...
|