-
Notifications
You must be signed in to change notification settings - Fork 804
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
dynamodb: Ability to override the table name #2935
Comments
Thank you for reaching out @moznion, marking as a feature request. |
Hi, I need this feature too. How is the progress of this feature request? Is this planned to come in some release in the future? |
Hi, I'm currently migrating the SDK from v1 to v2 and just noticed that this feature is missing. This could be a blocker. |
I am migrating the SDK from v1 to v2 and this could be blocker. |
same. this feature is a blocker for us. |
Follow this doc, I could custom the table name as below sample code: Create a CustomDynamoDbTableNameResolver: import io.awspring.cloud.dynamodb.DynamoDbTableNameResolver;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Value;
import java.util.Map;
public class CustomDynamoDbTableNameResolver implements DynamoDbTableNameResolver {
@Value("${tables.table1}")
private String table1;
@Value("${tables.table2}")
private String table2;
@NotNull
@Override
public <T> String resolve(@NotNull Class<T> clazz) {
return classTableNameMap().get(clazz);
}
private Map<Class<?>, String> classTableNameMap() {
return Map.of(Table1.class, table1, Table2.class, table2);
}
} Then declare a bean of type DynamoDbTableSchemaResolver by using CustomDynamoDbTableNameResolver: @Bean
public DynamoDbTableNameResolver dynamoDbTableNameResolver() {
return new CustomDynamoDbTableNameResolver();
} Hope this helps! |
…157247b7d Pull request: release <- staging/2da2f53b-4db9-41c8-b6c6-48b157247b7d
Describe the feature
Currently, it seems there are no features to override the DynamoDB table name, like an equivalent to the V1 SDK's
DynamoDBMapperConfig.Builder#withTableNameOverride() and DynamoDBMapperConfig.TableNameOverride.withTableNamePrefix() .
This feature is useful to configure the DynamoDBs' table names dynamically. I'd like to use the equivalent function on V2 SDK as well.
Is your Feature Request related to a problem?
This is one of the blockers to upgrade the SDK to v2 from v1 for us.
Proposed Solution
No response
Describe alternatives you've considered
No response
Acknowledge
AWS Java SDK version used
2.17.102
JDK version used
openjdk version "11.0.11" 2021-04-20 LTS
OpenJDK Runtime Environment Corretto-11.0.11.9.1 (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.11.9.1 (build 11.0.11+9-LTS, mixed mode)
Operating System and version
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: