diff --git a/src/main/asciidoc/reference/aerospike-object-mapping.adoc b/src/main/asciidoc/reference/aerospike-object-mapping.adoc index 8689f1cf2..28a0d1d48 100644 --- a/src/main/asciidoc/reference/aerospike-object-mapping.adoc +++ b/src/main/asciidoc/reference/aerospike-object-mapping.adoc @@ -62,7 +62,7 @@ The MappingAerospikeConverter can use metadata to drive the mapping of objects t * `@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. Must be effectively not larger than integer. +* `@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). diff --git a/src/test/java/org/springframework/data/aerospike/sample/SampleClasses.java b/src/test/java/org/springframework/data/aerospike/sample/SampleClasses.java index 923208cb3..da256a304 100644 --- a/src/test/java/org/springframework/data/aerospike/sample/SampleClasses.java +++ b/src/test/java/org/springframework/data/aerospike/sample/SampleClasses.java @@ -196,7 +196,7 @@ public static class DocumentExampleIdClass { DocumentExample id; long counter; @Version - int version; // must be integer + int version; // the value must be effectively integer @Field("update") Long timestamp; } @@ -564,7 +564,7 @@ public static class idAndAddressesList { public static class VersionedClass { @Version - private int version; // must be integer + private int version; // the value must be effectively integer private String field; @Id private String id; @@ -590,7 +590,7 @@ public static class VersionedClassWithAllArgsConstructor { @Id private String id; @Version - private int version; // must be integer + private int version; // the value must be effectively integer @PersistenceCreator public VersionedClassWithAllArgsConstructor(String id, String field, int version) { @@ -722,7 +722,7 @@ public static class DocumentWithTouchOnRead { private int field; @Version - private int version; // must be integer + private int version; // the value must be effectively integer public DocumentWithTouchOnRead(String id) { this(id, 0); @@ -744,7 +744,7 @@ public static class DocumentWithExpirationAnnotation { private String id; @Expiration - private Integer expiration; + private Integer expiration; // the value must be effectively integer } @Value @@ -755,7 +755,7 @@ public static class DocumentWithExpirationAnnotationAndPersistenceConstructor { String id; @Expiration - int expiration; + int expiration; // the value must be effectively integer @PersistenceCreator public DocumentWithExpirationAnnotationAndPersistenceConstructor(String id, int expiration) { @@ -831,7 +831,7 @@ public static class DocumentWithExpirationOneDay { @Id private String id; @Version - private int version; // must be integer + private long version; // the value must be effectively integer @PersistenceCreator public DocumentWithExpirationOneDay(String id) { @@ -847,7 +847,7 @@ public static class DocumentWithTouchOnReadAndExpirationProperty { @Id private String id; @Expiration - private int expiration; + private int expiration; // the value must be effectively integer } @Document(collection = DocumentWithExpressionInCollection.COLLECTION_PREFIX + "${setSuffix}") @@ -901,7 +901,7 @@ public static class DocumentWithBigIntegerAndNestedArray { public static class ObjectWithIntegerArray { @Version - private int version; // must be integer + private Integer version; // the value must be effectively integer Integer[] array; public ObjectWithIntegerArray(Integer[] array) {