1
1
package com .aerospike .mapper .annotations ;
2
2
3
+ import com .aerospike .client .policy .GenerationPolicy ;
4
+ import com .aerospike .client .policy .WritePolicy ;
5
+
3
6
import java .lang .annotation .ElementType ;
4
7
import java .lang .annotation .Retention ;
5
8
import java .lang .annotation .RetentionPolicy ;
8
11
/**
9
12
* Mark a field or property to be used for optimistic concurrency control using Aerospike's generation field.
10
13
* <p/>
11
- * The field or property must be of Integer or int type. When reading an object which has a field marked
12
- * with @AerospikeGeneration, the returned record's generation field will be mapped into the @AerospikeGeneration field.
13
- * When writing the record, if the @AerospikeGeneration field is non-zero, the generation will be set in the
14
- * writePolicy. generation field and the writePolicy. generationPolicy will be set to
15
- * GenerationPolicy. EXPECT_GEN_EQUAL.
14
+ * The field or property must be of Integer or int type. When reading an object which has a field marked
15
+ * with @AerospikeGeneration, the returned record's generation field will be mapped into the @AerospikeGeneration field.
16
+ * When writing the record, if the @AerospikeGeneration field is non-zero, the generation will be set in the
17
+ * {@link WritePolicy# generation} field and the {@link WritePolicy# generationPolicy} will be set to
18
+ * {@link GenerationPolicy# EXPECT_GEN_EQUAL} .
16
19
* <p/>
17
20
* Example usage:
18
21
* <pre>
22
25
* private int id;
23
26
* @AerospikeBin
24
27
* private String name;
25
- * @Version
26
- * private int version ;
28
+ * @AerospikeGeneration
29
+ * private int generation ;
27
30
* }
28
31
* </pre>
29
32
*
32
35
@ Retention (RetentionPolicy .RUNTIME )
33
36
@ Target ({ElementType .FIELD , ElementType .METHOD })
34
37
public @interface AerospikeGeneration {
35
- }
38
+ }
0 commit comments