Skip to content

Commit e6c8bb5

Browse files
committed
TableSchema API to create table and functional tests
1 parent fcbc4ae commit e6c8bb5

23 files changed

+2768
-65
lines changed

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/TableSchema.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
import java.util.Map;
2121
import software.amazon.awssdk.annotations.SdkPublicApi;
2222
import software.amazon.awssdk.annotations.ThreadSafe;
23+
import software.amazon.awssdk.enhanced.dynamodb.document.EnhancedDocument;
2324
import software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema;
25+
import software.amazon.awssdk.enhanced.dynamodb.mapper.DocumentTableSchema;
2426
import software.amazon.awssdk.enhanced.dynamodb.mapper.ImmutableTableSchema;
2527
import software.amazon.awssdk.enhanced.dynamodb.mapper.StaticImmutableTableSchema;
2628
import software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableSchema;
@@ -84,6 +86,17 @@ static <T> BeanTableSchema<T> fromBean(Class<T> beanClass) {
8486
return BeanTableSchema.create(beanClass);
8587
}
8688

89+
90+
/**
91+
* Provides interfaces to interact with DynamoDB tables as {@link EnhancedDocument} where the complete Schema of the table
92+
* is not required.
93+
* @return A {@link DocumentTableSchema.Builder} for instantiating DocumentTableSchema.
94+
*
95+
*/
96+
static DocumentTableSchema.Builder fromDocumentSchemaBuilder(){
97+
return DocumentTableSchema.builder();
98+
}
99+
87100
/**
88101
* Scans an immutable class that has been annotated with DynamoDb immutable annotations and then returns a
89102
* {@link ImmutableTableSchema} implementation of this interface that can map records to and from items of that

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/document/EnhancedDocument.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ interface Builder {
461461
* @param value The list of values that needs to be set.
462462
* @return Builder instance to construct a {@link EnhancedDocument}
463463
*/
464-
Builder addList(String attributeName, List<?> value);
464+
Builder addList(String attributeName, List<? extends Object> value);
465465

466466
/**
467467
* Appends an attribute of name attributeName with specified map values to the document builder.
@@ -470,7 +470,7 @@ interface Builder {
470470
* @param value The map that needs to be set.
471471
* @return Builder instance to construct a {@link EnhancedDocument}
472472
*/
473-
Builder addMap(String attributeName, Map<String, ?> value);
473+
Builder addMap(String attributeName, Map<String, ? extends Object> value);
474474

475475
/**
476476
* Appends an attribute of name attributeName with specified value of the given JSON document in the form of a string.

0 commit comments

Comments
 (0)