use of software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableSchema in project aws-sdk-java-v2 by aws.
the class BatchGetItemTest method setup.
@Before
public void setup() {
DynamoDbClient dynamoDbClient = DynamoDbClient.builder().region(Region.US_WEST_2).credentialsProvider(() -> AwsBasicCredentials.create("foo", "bar")).endpointOverride(URI.create("http://localhost:" + wireMock.port())).endpointDiscoveryEnabled(false).build();
enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(dynamoDbClient).build();
StaticTableSchema<Record> tableSchema = StaticTableSchema.builder(Record.class).newItemSupplier(Record::new).addAttribute(Integer.class, a -> a.name("id").getter(Record::getId).setter(Record::setId).tags(primaryPartitionKey())).build();
table = enhancedClient.table("table", tableSchema);
}
use of software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableSchema in project aws-sdk-java-v2 by aws.
the class AsyncBatchGetItemTest method setup.
@Before
public void setup() {
DynamoDbAsyncClient dynamoDbClient = DynamoDbAsyncClient.builder().region(Region.US_WEST_2).credentialsProvider(() -> AwsBasicCredentials.create("foo", "bar")).endpointOverride(URI.create("http://localhost:" + wireMock.port())).endpointDiscoveryEnabled(false).build();
enhancedClient = DynamoDbEnhancedAsyncClient.builder().dynamoDbClient(dynamoDbClient).build();
StaticTableSchema<Record> tableSchema = StaticTableSchema.builder(Record.class).newItemSupplier(Record::new).addAttribute(Integer.class, a -> a.name("id").getter(Record::getId).setter(Record::setId).tags(primaryPartitionKey())).build();
table = enhancedClient.table("table", tableSchema);
}
Aggregations