diff --git a/documentation/src/main/asciidoc/introduction/Entities.adoc b/documentation/src/main/asciidoc/introduction/Entities.adoc index a4be5745b09d..71c05a10503c 100644 --- a/documentation/src/main/asciidoc/introduction/Entities.adoc +++ b/documentation/src/main/asciidoc/introduction/Entities.adoc @@ -458,6 +458,18 @@ It's easy to specify that the initial version should be assigned the number `1` int version = 1; // the initial version number ---- +If the version attribute is an `Instant` or datetime, the value assigned to the attribute is generated in the JVM by default. + +[TIP] +==== +If the datetime value should be generated by the database, the `@Version` annotation may be used in conjunction with a <>, for example: +[source,java] +---- +@CurrentTimestamp @Version +LocalDateTime lastUpdated; +---- +==== + Almost every entity which is frequently updated should have a version attribute. [TIP]