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

The following examples show how to use com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable. 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: BaseDatabaseControllerTest.java    From nfscan with MIT License 4 votes vote down vote up
private String extractTableName(Class<? extends IDomain> domain){
    return domain.getAnnotation(DynamoDBTable.class).tableName();
}