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

The following examples show how to use com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBRangeKey. 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: DynamoDBMappingContext.java    From spring-data-dynamodb with Apache License 2.0 6 votes vote down vote up
@Override
protected boolean shouldCreatePersistentEntityFor(TypeInformation<?> type) {

	boolean hasHashKey = false;
	boolean hasRangeKey = false;
	for (Method method : type.getType().getMethods()) {
		if (method.isAnnotationPresent(DynamoDBHashKey.class))
			hasHashKey = true;
		if (method.isAnnotationPresent(DynamoDBRangeKey.class))
			hasRangeKey = true;

	}
	for (Field field : type.getType().getFields()) {
		if (field.isAnnotationPresent(DynamoDBHashKey.class))
			hasHashKey = true;
		if (field.isAnnotationPresent(DynamoDBRangeKey.class))
			hasRangeKey = true;

	}
	return type.getType().isAnnotationPresent(DynamoDBTable.class) || (hasHashKey && hasRangeKey);
}
 
Example #2
Source File: MapperQueryExpressionCryptoTest.java    From aws-dynamodb-encryption-java with Apache License 2.0 5 votes vote down vote up
@DynamoDBRangeKey
@DynamoDBIndexRangeKey(
        globalSecondaryIndexNames = {"GSI-index-hash-primary-range"},
        localSecondaryIndexName = "LSI-primary-range"
)
public String getPrimaryRangeKey() {
    return primaryRangeKey;
}
 
Example #3
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 #4
Source File: DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getRangeKey(){  return null;}
 
Example #5
Source File: RangeKeyTestClass.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public double getRangeKey() {
    return rangeKey;
}
 
Example #6
Source File: BaseClass.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public int getRangeKey() {
    return rangeKey;
}
 
Example #7
Source File: KeysOnly.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public int getRangeKey() {
    return rangeKey;
}
 
Example #8
Source File: ThreadId.java    From spring-data-dynamodb-demo with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getSubject() {
	return subject;
}
 
Example #9
Source File: Thread.java    From spring-data-dynamodb-demo with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName = "Subject")
public String getSubject() {
	return threadId != null ? threadId.getSubject() : null;
}
 
Example #10
Source File: ReplyId.java    From spring-data-dynamodb-demo with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getReplyDateTime() {
	return replyDateTime;
}
 
Example #11
Source File: Reply.java    From spring-data-dynamodb-demo with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName = "ReplyDateTime")
public String getReplyDateTime() {
	return replyId != null ? replyId.getReplyDateTime() : null;
}
 
Example #12
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 #13
Source File: DynamoDBHashAndRangeKey.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public Object getRangeKey() {
	return rangeKey;
}
 
Example #14
Source File: MapperQueryExpressionCryptoTest.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getPrimaryRangeKey() {
    return primaryRangeKey;
}
 
Example #15
Source File: DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getRangeKey(){  return null;}
 
Example #16
Source File: DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getOtherRangeKey(){  return null;}
 
Example #17
Source File: DynamoDBHashAndRangeKeyMethodExtractorImplUnitTest.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getRangeKey(){  return null;}
 
Example #18
Source File: Playlist.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName = "range")
public String getPlaylistName() {
	return playlistId != null ? playlistId.getPlaylistName() : null;
}
 
Example #19
Source File: PlaylistId.java    From spring-data-dynamodb with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getPlaylistName() {
	return playlistName;
}
 
Example #20
Source File: DynamoDBStringItem.java    From openhab1-addons with Eclipse Public License 2.0 4 votes vote down vote up
@Override
@DynamoDBRangeKey(attributeName = ATTRIBUTE_NAME_TIMEUTC)
public Date getTime() {
    return time;
}
 
Example #21
Source File: DynamoDBBigDecimalItem.java    From openhab1-addons with Eclipse Public License 2.0 4 votes vote down vote up
@Override
@DynamoDBRangeKey(attributeName = ATTRIBUTE_NAME_TIMEUTC)
public Date getTime() {
    return time;
}
 
Example #22
Source File: ObjectPersistenceQueryScanExample.java    From aws-dynamodb-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName="ReplyDateTime")
public String getReplyDateTime() { return replyDateTime; }
 
Example #23
Source File: ObjectPersistenceQueryScanExample.java    From aws-dynamodb-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName="Subject")
public String getSubject() { return subject; }
 
Example #24
Source File: ObjectPersistenceBatchWriteExample.java    From aws-dynamodb-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName="ReplyDateTime")
public String getReplyDateTime() { return replyDateTime; }
 
Example #25
Source File: ObjectPersistenceBatchWriteExample.java    From aws-dynamodb-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName="Subject")
public String getSubject() { return subject; }
 
Example #26
Source File: MapperSaveConfigCryptoIntegrationTestBase.java    From aws-dynamodb-encryption-java with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName = rangeKeyName)
public Long getRangeKey() {
    return rangeKey;
}
 
Example #27
Source File: Device.java    From spring-data-dynamodb-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName = "ProductId")
public String getProductId() {
	return (key != null) ? key.getProduct() : null;
}
 
Example #28
Source File: DeviceKey.java    From spring-data-dynamodb-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey
public String getProduct() {
	return product;
}
 
Example #29
Source File: UseDynamoMapping.java    From aws-doc-sdk-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName="SongTitle")
public String getSongTitle() {
    return this.songTitle;
}
 
Example #30
Source File: DynamoDBMapperBatchWriteExample.java    From aws-doc-sdk-examples with Apache License 2.0 4 votes vote down vote up
@DynamoDBRangeKey(attributeName = "ReplyDateTime")
public String getReplyDateTime() {
    return replyDateTime;
}