@Retention(value=RUNTIME) @Target(value={FIELD,METHOD,ANNOTATION_TYPE}) public @interface DynamoDBVersioned
@DynamoDBVersioned public Long getRecordVersionNumber()
Alternately, the convinience annotation DynamoDBVersionAttribute
may be used if combining with an attribute name on a field/getter.
Only nullable, integral numeric types (e.g. Integer, Long) can be used as
version properties. On a save() operation, the DynamoDBMapper
will
attempt to increment the version property and assert that the service's value
matches the client's.
New objects will be assigned a version of 1 when saved.
Note that for batchWrite, and by extension batchSave and batchDelete,
no version checks are performed, as required by the
AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)
API.
Note that for transactionWrite, no version checks are performed.
An SdkClientException
exception is thrown, if class of
any input object is annotated with DynamoDBVersioned
.
May be used as a meta-annotation.
DynamoDBVersionAttribute
Copyright © 2020. All rights reserved.