From 026af190c671a09a2e84a8734fc6db56a7fadbb5 Mon Sep 17 00:00:00 2001 From: agrgr Date: Sun, 23 Jun 2024 11:07:21 +0300 Subject: [PATCH] add Expiration annotation description to the documentation --- .../asciidoc/reference/aerospike-object-mapping.adoc | 10 +++++++--- .../data/aerospike/annotation/Expiration.java | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/asciidoc/reference/aerospike-object-mapping.adoc b/src/main/asciidoc/reference/aerospike-object-mapping.adoc index 28a0d1d48..64fe372a7 100644 --- a/src/main/asciidoc/reference/aerospike-object-mapping.adoc +++ b/src/main/asciidoc/reference/aerospike-object-mapping.adoc @@ -58,14 +58,18 @@ NOTE: AbstractAerospikeConfiguration will create an AerospikeTemplate instance a [[mapping-usage-annotations]] === Mapping Annotation Overview -The MappingAerospikeConverter can use metadata to drive the mapping of objects to documents. An overview of the annotations is provided below +The MappingAerospikeConverter can use metadata to drive the mapping of objects to documents using annotations. An overview of the annotations is provided below * `@Id` - applied at the field level to mark the field used for identity purposes. * `@Field` - applied at the field level, describes the name of the field as it will be represented in the AerospikeDB BSON document thus allowing the name to be different from the field name of the class. * `@Version` - applied at the field level to mark record modification count. The value must be effectively integer. - In Spring Data Aerospike, documents come in two forms – non-versioned and versioned. -Documents with an `@Version` annotation have a version field populated by the corresponding record’s generation count. Version can be passed to a constructor or not (in that case it stays equal to zero). +Documents with an `@Version` annotation have a version field populated by the corresponding record’s generation count. +Version can be passed to a constructor or not (in that case it stays equal to zero). +* `@Expiration` - applied at the field level to mark a property to be used as expiration field. +Expiration can be specified in two flavors: as an offset in seconds from the current time or +as an absolute Unix timestamp. Client system time must be synchronized with Aerospike server system time, +otherwise expiration behaviour will be unpredictable. The mapping metadata infrastructure is defined in a separate spring-data-commons project that is technology-agnostic. Specific subclasses are used in the AerospikeDB support to support annotation-based metadata. Other strategies are also possible to put in place if there is demand. diff --git a/src/main/java/org/springframework/data/aerospike/annotation/Expiration.java b/src/main/java/org/springframework/data/aerospike/annotation/Expiration.java index 967989783..c4a5f7bc7 100644 --- a/src/main/java/org/springframework/data/aerospike/annotation/Expiration.java +++ b/src/main/java/org/springframework/data/aerospike/annotation/Expiration.java @@ -23,8 +23,8 @@ /** * Demarcates a property to be used as expiration field. Expiration can be specified in two flavors: as an offset in - * seconds from the current time or as an absolute Unix time stamp.

Client system time must be synchronized - * with aerospike server system time, otherwise expiration behaviour will be unpredictable. + * seconds from the current time or as an absolute Unix timestamp.

Client system time must be synchronized + * with Aerospike server system time, otherwise expiration behaviour will be unpredictable. */ @Documented @Retention(RetentionPolicy.RUNTIME)