Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TableNameResolver does not work with @DynamoDBIndexHashKey #291

Open
github4sanjay opened this issue Dec 9, 2020 · 3 comments
Open

TableNameResolver does not work with @DynamoDBIndexHashKey #291

github4sanjay opened this issue Dec 9, 2020 · 3 comments

Comments

@github4sanjay
Copy link

Expected Behavior

TableNameResolver should be called for every query

Actual Behavior

TableNameResolver is not called for secondary indexes

Steps to Reproduce the Problem

  1. Create a GSI
  2. Add @DynamoDBIndexHashKey in entity class
  3. Add table name resolver and add some prefix
  4. Run the query table name resolver wont be called

Specifications

implementation("com.amazonaws:aws-java-sdk-dynamodb:1.11.914")
implementation("com.amazonaws:aws-java-sdk-sts:1.11.914")
implementation("com.github.derjust:spring-data-dynamodb:5.1.0")
@xinatcg
Copy link

xinatcg commented Dec 15, 2020

ref: #263 (comment)

@EnableDynamoDBRepositories(dynamoDBMapperConfigRef = "dynamoDBMapperConfig")

@sharadgarg-roche
Copy link

Above workaround works for me.

@abhiverma31
Copy link

I'm trying to prefix the GSI name with env.name so that the GSI name is built dynamically, like separate names for the different environments - dev-{gsi-name}, qa-{gsi-name}. The DynamoDBMapperConfig it appears is capable only of overriding the table name (annotated by @DynamoDBTable), but the same does not work for the GSI. I've tried @EnableDynamoDBRepositories(dynamoDBMapperConfigRef = "dynamoDBMapperConfig") this but this also does not work re: overriding the GSI name.

Any suggestions on how we could possibly accomplish this ?

I'm using: implementation 'com.github.derjust:spring-data-dynamodb:5.1.0'

@derjust

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants