Annotation Interface DateUpdated
@Retention(RUNTIME)
@Target({METHOD,FIELD})
@Documented
@AutoPopulated
public @interface DateUpdated
Can be applied to date type to indicate the property should be populated when it was last updated.
- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe date created name.static final StringThe metadata key forskipIfPresent(). -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhen true, an existing non-null value will be preserved and not overwritten during auto-population on insert.Allows to truncate the auto set date value.
-
Field Details
-
NAME
The date created name. -
SKIP_IF_PRESENT
-
-
Element Details
-
skipIfPresent
boolean skipIfPresentWhen true, an existing non-null value will be preserved and not overwritten during auto-population on insert. This is intended for insert-time use cases such as backfills or imports where a caller already has a last-updated value. On later updates,@DateUpdatedkeeps its normal semantics and is always refreshed by Micronaut Data regardless of this flag or the current value. Default isfalseto preserve existing behavior.- Returns:
- true if the existing value should be preserved, false otherwise
- Since:
- 5.0
- Default:
false
-
truncatedTo
ChronoUnit truncatedToAllows to truncate the auto set date value.- Returns:
- the truncated to constant
- Since:
- 3.4.2
- Default:
FOREVER
-