michaellavelle / spring-data-dynamodb

Simplifies the development of creating an Amazon DynamoDB-based Java data access layer
https://derjust.github.io/spring-data-dynamodb/
Apache License 2.0
169 stars 284 forks source link

DynamoDBRepositoryConfigExtension.java uses wrong DYNAMO_DB_MAPPER_CONFIG_REF value #79

Closed joostlammers closed 4 years ago

joostlammers commented 8 years ago

According to the XSD, the following attributes are supported on the repositories element:

<xsd:extension base="repository:repositories">
<xsd:attribute name="amazon-dynamodb-ref" type="amazonDynamoDBRef" use="optional"/>
<xsd:attribute name="dynamodb-mapper-config-ref" type="dynamoDBMapperConfigRef" use="optional"/>
<xsd:attribute name="dynamodb-operations-ref" type="dynamoDBOperationsRef" use="optional"/>
</xsd:extension>

In the DynamoDBRepositoryConfigExtension.java it appears to be looking for different attributes:

private static final String AMAZON_DYNAMODB_REF = "amazon-dynamodb-ref";
private static final String DYNAMO_DB_MAPPER_CONFIG_REF = "dynamoDBMapperConfig";
private static final String DYNAMO_DB_OPERATIONS_REF = "dynamoDBOperations";

causing my dynamodb-mapper-config-ref value to be ignored.

shivarajan commented 7 years ago

any updates on this?

shivarajan commented 7 years ago

Currently broken in snapshot, This impl construct does not pickup the mapper config currently in git master snapshot unless fixed,

<dynamodb:repositories base-package="com.xyz.repositories" dynamodb-mapper-config-ref="aws-dynamodb-mapper-config" amazon-dynamodb-ref="aws-dynamodb-client" />

I've tested by changing below lines:

private static final String DYNAMO_DB_MAPPER_CONFIG_REF = "dynamoDBMapperConfig"; private static final String DYNAMO_DB_OPERATIONS_REF = "dynamoDBOperations"; private static final String AMAZON_DYNAMODB_REF = "amazon-dynamodb-ref";

@https://github.com/michaellavelle/spring-data-dynamodb/blob/master/src/main/java/org/socialsignin/spring/data/dynamodb/repository/config/DynamoDBRepositoryConfigExtension.java

to,

private static final String DYNAMO_DB_MAPPER_CONFIG_REF = "dynamodb-mapper-config-ref"; private static final String DYNAMO_DB_OPERATIONS_REF = "dynamodb-operations-ref"; private static final String AMAZON_DYNAMODB_REF = "amazon-dynamodb-ref";

compiled, tested which seems to "work".

suryavikas commented 7 years ago

Do we plan to merge this onto master ?

derjust commented 6 years ago

Hi! This was fixed some time ago in a fork of this project: https://github.com/derjust/spring-data-dynamodb/commit/b8bd30f9623eb1705914f86a9f603c6100d17ba1 and went into the 5.0.1 release