Hi there,
I have an updatedOn field annotated with @Generated(@Generated(GenerationTime.ALWAYS)).
The database is MySQL and the column is defined as:
`updatedOn` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
I want to be able to override the default value when I insert. This is necessary to implement versionning where I'd like to copy a row, including its updatedOn column.
I understand the current Hibernate behavior. However, the way I see it, a default value is the value used by the database when no value is provided. Currently, the updatedOn column is not included in the generated SQL, but is refetched after the insert.
Thank you for your help.
Remy
|