Skip to content

Commit 1dec655

Browse files
committed
Fixed a couple of references to version instead of generation
1 parent d9f4c33 commit 1dec655

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/main/java/com/aerospike/mapper/annotations/AerospikeGeneration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* Mark a field or property to be used for optimistic concurrency control using Aerospike's generation field.
1010
* <p/>
1111
* The field or property must be of Integer or int type. When reading an object which has a field marked
12-
* with @Version, the returned record's generation field will be mapped into the @Version field.
13-
* When writing the record, if the @Version field is non-zero, the generation will be set in the
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
1414
* writePolicy.generation field and the writePolicy.generationPolicy will be set to
1515
* GenerationPolicy.EXPECT_GEN_EQUAL.
1616
* <p/>

src/main/java/com/aerospike/mapper/tools/AeroMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ private <T> WritePolicy generateWritePolicyFromObject(T object) {
123123
writePolicy.sendKey = sendKey;
124124
}
125125

126-
// #181 Handle @Version field for optimistic concurrency control
127-
Integer versionValue = entry.getGenerationValue(object);
128-
if (versionValue != null && versionValue > 0) {
129-
writePolicy.generation = versionValue;
126+
// #181 Handle @AerospikeGeneration field for optimistic concurrency control
127+
Integer generationValue = entry.getGenerationValue(object);
128+
if (generationValue != null && generationValue > 0) {
129+
writePolicy.generation = generationValue;
130130
writePolicy.generationPolicy = GenerationPolicy.EXPECT_GEN_EQUAL;
131131
}
132132

src/main/java/com/aerospike/mapper/tools/ReactiveAeroMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private <T> WritePolicy generateWritePolicyFromObject(T object) {
109109
writePolicy.sendKey = sendKey;
110110
}
111111

112-
// #181 Handle @Version field for optimistic concurrency control
112+
// #181 Handle @AerospikeGeneration field for optimistic concurrency control
113113
Integer generationValue = entry.getGenerationValue(object);
114114
if (generationValue != null && generationValue > 0) {
115115
writePolicy.generation = generationValue;

src/main/java/com/aerospike/mapper/tools/configuration/BinConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public void setReference(ReferenceConfig reference) {
9292
this.reference = reference;
9393
}
9494

95-
public void setGeneration(Boolean version) {
96-
this.generation = version;
95+
public void setGeneration(Boolean generation) {
96+
this.generation = generation;
9797
}
9898

9999
public void validate(String className) {

src/main/java/com/aerospike/mapper/tools/configuration/ClassConfig.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ClassConfig {
1717
private String namespace;
1818
private String set;
1919
private Integer ttl;
20-
private Integer generation;
20+
private Integer version;
2121
private Boolean sendKey;
2222
private Boolean mapAll;
2323
private Boolean durableDelete;
@@ -48,7 +48,7 @@ public Integer getTtl() {
4848
}
4949

5050
public Integer getVersion() {
51-
return generation;
51+
return version;
5252
}
5353

5454
public Boolean getSendKey() {
@@ -140,8 +140,8 @@ private void setTtl(Integer ttl) {
140140
this.ttl = ttl;
141141
}
142142

143-
private void setGeneration(Integer generation) {
144-
this.generation = generation;
143+
private void setVersion(Integer version) {
144+
this.version = version;
145145
}
146146

147147
private void setSendKey(Boolean sendKey) {
@@ -199,8 +199,8 @@ public Builder withTtl(int ttl) {
199199
return this;
200200
}
201201

202-
public Builder withGeneration(int generation) {
203-
this.classConfig.setGeneration(generation);
202+
public Builder withVersion(int version) {
203+
this.classConfig.setVersion(version);
204204
return this;
205205
}
206206

0 commit comments

Comments
 (0)