com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBVersionAttribute Java Examples

The following examples show how to use com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBVersionAttribute. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DynamoDBEntityMetadataSupport.java    From spring-data-dynamodb with Apache License 2.0 5 votes vote down vote up
public String getOverriddenAttributeName(Method method) {

		if (method != null) {
			if (method.getAnnotation(DynamoDBAttribute.class) != null
					&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBAttribute.class).attributeName())) {
				return method.getAnnotation(DynamoDBAttribute.class).attributeName();
			}
			if (method.getAnnotation(DynamoDBHashKey.class) != null
					&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBHashKey.class).attributeName())) {
				return method.getAnnotation(DynamoDBHashKey.class).attributeName();
			}
			if (method.getAnnotation(DynamoDBRangeKey.class) != null
					&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBRangeKey.class).attributeName())) {
				return method.getAnnotation(DynamoDBRangeKey.class).attributeName();
			}
			if (method.getAnnotation(DynamoDBIndexRangeKey.class) != null
					&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName())) {
				return method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName();
			}
			if (method.getAnnotation(DynamoDBIndexHashKey.class) != null
					&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) {
				return method.getAnnotation(DynamoDBIndexHashKey.class).attributeName();
			}
			if (method.getAnnotation(DynamoDBVersionAttribute.class) != null
					&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBVersionAttribute.class).attributeName())) {
				return method.getAnnotation(DynamoDBVersionAttribute.class).attributeName();
			}
		}
		return null;

	}
 
Example #2
Source File: VersionAttributeUpdateITCase.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public String getVersion() {
    return version;
}
 
Example #3
Source File: VersionAttributeUpdateITCase.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public BigInteger getVersion() {
    return version;
}
 
Example #4
Source File: VersionAttributeUpdateITCase.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute(attributeName = "version")
public Integer getNotCalledVersion() {
    return notCalledVersion;
}
 
Example #5
Source File: VersionAttributeUpdateITCase.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public Byte getVersion() {
    return version;
}
 
Example #6
Source File: VersionAttributeUpdateITCase.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public Long getVersion() {
    return version;
}
 
Example #7
Source File: ExceptionHandlingITCase.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public Double getVersion() {
    return version;
}
 
Example #8
Source File: IndexRangeKeyTestClass.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DoNotEncrypt
@DynamoDBVersionAttribute
public Long getVersion() {
    return version;
}
 
Example #9
Source File: CrossSDKVerificationTestClass.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DoNotEncrypt
@DynamoDBVersionAttribute
public Long getVersion() {
    return version;
}
 
Example #10
Source File: RangeKeyTestClass.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DoNotEncrypt
@DynamoDBVersionAttribute
public Long getVersion() {
    return version;
}
 
Example #11
Source File: BaseClass.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public Integer getVersion() {
    return version;
}
 
Example #12
Source File: DynamoDBPersistentPropertyImpl.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isVersionProperty() {
	return super.isVersionProperty() || isAnnotationPresent(DynamoDBVersionAttribute.class);
}
 
Example #13
Source File: DynamoDBEntityMetadataSupport.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@Override
public String getOverriddenAttributeName(final String propertyName) {

	Method method = findMethod(propertyName);
	if (method != null) {
		if (method.getAnnotation(DynamoDBAttribute.class) != null
				&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBAttribute.class).attributeName())) {
			return method.getAnnotation(DynamoDBAttribute.class).attributeName();
		}
		if (method.getAnnotation(DynamoDBHashKey.class) != null
				&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBHashKey.class).attributeName())) {
			return method.getAnnotation(DynamoDBHashKey.class).attributeName();
		}
		if (method.getAnnotation(DynamoDBRangeKey.class) != null
				&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBRangeKey.class).attributeName())) {
			return method.getAnnotation(DynamoDBRangeKey.class).attributeName();
		}
		if (method.getAnnotation(DynamoDBIndexRangeKey.class) != null
				&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName())) {
			return method.getAnnotation(DynamoDBIndexRangeKey.class).attributeName();
		}
		if (method.getAnnotation(DynamoDBIndexHashKey.class) != null
				&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) {
			return method.getAnnotation(DynamoDBIndexHashKey.class).attributeName();
		}
		if (method.getAnnotation(DynamoDBVersionAttribute.class) != null
				&& StringUtils.isNotEmpty(method.getAnnotation(DynamoDBVersionAttribute.class).attributeName())) {
			return method.getAnnotation(DynamoDBVersionAttribute.class).attributeName();
		}
	}

	Field field = findField(propertyName);
	if (field != null) {
		if (field.getAnnotation(DynamoDBAttribute.class) != null
				&& StringUtils.isNotEmpty(field.getAnnotation(DynamoDBAttribute.class).attributeName())) {
			return field.getAnnotation(DynamoDBAttribute.class).attributeName();
		}
		if (field.getAnnotation(DynamoDBHashKey.class) != null
				&& StringUtils.isNotEmpty(field.getAnnotation(DynamoDBHashKey.class).attributeName())) {
			return field.getAnnotation(DynamoDBHashKey.class).attributeName();
		}
		if (field.getAnnotation(DynamoDBRangeKey.class) != null
				&& StringUtils.isNotEmpty(field.getAnnotation(DynamoDBRangeKey.class).attributeName())) {
			return field.getAnnotation(DynamoDBRangeKey.class).attributeName();
		}
		if (field.getAnnotation(DynamoDBIndexRangeKey.class) != null
				&& StringUtils.isNotEmpty(field.getAnnotation(DynamoDBIndexRangeKey.class).attributeName())) {
			return field.getAnnotation(DynamoDBIndexRangeKey.class).attributeName();
		}
		if (field.getAnnotation(DynamoDBIndexHashKey.class) != null
				&& StringUtils.isNotEmpty(field.getAnnotation(DynamoDBIndexHashKey.class).attributeName())) {
			return field.getAnnotation(DynamoDBIndexHashKey.class).attributeName();
		}
		if (field.getAnnotation(DynamoDBVersionAttribute.class) != null
				&& StringUtils.isNotEmpty(field.getAnnotation(DynamoDBVersionAttribute.class).attributeName())) {
			return field.getAnnotation(DynamoDBVersionAttribute.class).attributeName();
		}
	}
	return null;

}
 
Example #14
Source File: MapperTransactionsIntegrationTest.java    From dynamodb-transactions with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public Long getVersion() {
    return version;
}
 
Example #15
Source File: TransactionExamples.java    From dynamodb-transactions with Apache License 2.0 4 votes vote down vote up
@DynamoDBVersionAttribute
public Long getVersion() {
    return version;
}