Skip to content

Commit cd165f1

Browse files
authored
doc: mention the validation requirement for auto-timestamps (#2853)
1 parent 9e2d1a2 commit cd165f1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/docs/guide/shared/dataUpdates/timestamps.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,16 @@ You can annotate a property that is a date type of entity with ann:data.annotati
55
You can also annotate a property that is a date type of entity with ann:data.annotation.DateUpdated[] which will be automatically populated whenever the entity is updated either via the `persist` method or when using one of the batch update methods of Micronaut Data.
66

77
NOTE: If you update the entity with an external SQL statement or custom logic you will need to update the underlying `DateUpdated` column manually.
8+
9+
=== JPA Hibernate and Entity Timestamps
10+
11+
The ann:data.annotation.DateCreated[] and ann:data.annotation.DateUpdated[] annotations require a `ValidatorFactory` bean to be present in the application context when used with JPA Hibernate.
12+
This can be provided by ensuring one of
13+
14+
dependency::io.micronaut.validation:micronaut-validation[]
15+
16+
or
17+
18+
dependency::io.micronaut.beanvalidation:micronaut-hibernate-validator[]
19+
20+
is added to your project.

0 commit comments

Comments
 (0)