Annotation Type AerospikeVersion


@Retention(RUNTIME)
@Target({FIELD,METHOD})
public @interface AerospikeVersion
Specify the version of a record. Records without the @AerospikeVersion annotation are assumed to be version 1 of a record.

Versions are typically used for embedded records to be stored in a list. Since a list item has no name associated with it, the order of the attributes determines which part of the object to map the value to. By default the items are mapped alphabetically, but this presents issues is an item is added or removed from the object.

For example, consider a Person object with an Account stored as a list:

 @AerospikeRecord(namespace = "test", set = "account")
 public class Account {
     @AerospikeBin
     private String name;
     @AerospikeBin
     private int balance
 }

 @AerospikeRecord(namespace = "test", set = "people")
 public class Person {
     @AerospikeBin
     private String name;
     @AerospikeBin
     @AerospikeEmbed(type = EmbedType.LIST)
     private Account account;
 }
 
Author:
timfaulkes
  • Optional Element Summary

    Optional Elements
    Modifier and Type Optional Element Description
    int max  
    int min  
  • Element Details

    • min

      int min
      Default:
      1
    • max

      int max
      Default:
      2147483647