I'm currently trying to convert from hbm.xml files to annotations.
I don't find a documentation how to convert
<version column="version" name="version" type="int" unsaved-value="negative" />
My solution would look like this...
@Version
@Column(name = "version")
private int version;
is this correct ... I'm not sure about the 'unsaved-value' part?
I took a look at https://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/mapping.html at 5.1.2. Identifiers it says
The unsaved-value attribute is almost never needed in Hibernate3 and indeed has no corresponding element in annotations.
finally after adding all the annotations I'd like to update Hibernate to the last version (from 3.0) and I'm using a MySQL database.