JPA @Version annotation with Timestamp and insert
Hi. I have the @Version annotation specified on a Timestamp field of my entity. The versioning works correctly as long as the Date is populated in the database, but when I insert an entity, I get a StaleObjectException. After some research, I found several references saying that the @Version attribute should not be set manually. So my question is: Does the @Version annotation initialize a Timestamp on insert by default, or is there some other annotation (eg - @Temporal or something) that has an attribute that specifies a default value on insert?
Thanks for your time.