I can get this feature to work with this set of annotations on the version field:
Code:
@Version
@Column(insertable = false, updatable = false)
@Generated(GenerationTime.ALWAYS)
private Timestamp versionDate;
With the above annotations, I can use a Date or Timestamp type which is populated solely by the database (Oracle in this case).
However, in my domain, versionDate is really a last modified date. When new instances are created, this field is null and is only populated after an UPDATE is executed. How do I let the system know that null is the initial version? Or is there an alternative?
Thanks,
Kevin