@@ -87,6 +87,10 @@ values used are also completely arbitrary.
87
87
// Maps a physical table with the name 'customers_20190205' to the schema
88
88
DynamoDbTable<Customer > customerTable = enhancedClient. table(" customers_20190205" , CUSTOMER_TABLE_SCHEMA );
89
89
```
90
+
91
+ The name passed to the `table()` method above must match the name of a DynamoDB table if it already exists.
92
+ The DynamoDbTable object, customerTable, can now be used to perform the basic operations on the `customers_20190205` table.
93
+ If the table does not already exist, the name will be used as the DynamoDB table name on a subsequent `createTable()` method.
90
94
91
95
### Common primitive operations
92
96
These all strongly map to the primitive DynamoDB operations they are
@@ -363,6 +367,32 @@ Or using a StaticTableSchema with custom values:
363
367
.tags(atomicCounter(10L, 5L))
364
368
```
365
369
370
+ ### AutoGeneratedTimestampRecordExtension
371
+
372
+ This extension enables selected attributes to be automatically updated with a current timestamp every time the item
373
+ is successfully written to the database. One requirement is the attribute must be of `Instant` type.
374
+
375
+ This extension is not loaded by default, you need to specify it as custom extension while creating the enhanced
376
+ client.
377
+
378
+ To tell the extension which attribute will be updated with the current timestamp, tag the Instant attribute in
379
+ the TableSchema:
380
+ ```java
381
+ @DynamoDbAutoGeneratedTimestampAttribute
382
+ public Instant getLastUpdate() {...}
383
+ public void setLastUpdate(Instant lastUpdate) {...}
384
+ ```
385
+
386
+ If using a StaticTableSchema:
387
+ ```java
388
+ .addAttribute(Instant.class, a -> a.name("lastUpdate")
389
+ .getter(Customer::getLastUpdate)
390
+ .setter(Customer::setLastUpdate)
391
+ // Applying the ' autoGeneratedTimestamp' tag to the attribute
392
+ .tags(autoGeneratedTimestampAttribute())
393
+ ```
394
+
395
+
366
396
## Advanced table schema features
367
397
### Explicitly include/exclude attributes in DDB mapping
368
398
#### Excluding attributes
@@ -391,6 +421,10 @@ By default, the table schema provides converters for all primitive and many comm
391
421
through a default implementation of the AttributeConverterProvider interface. This behavior
392
422
can be changed both at the attribute converter provider level as well as for a single attribute.
393
423
424
+ You can find a list of the available converters in the
425
+ [AttributeConverter](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/enhanced/dynamodb/AttributeConverter.html)
426
+ interface Javadoc.
427
+
394
428
#### Provide custom attribute converter providers
395
429
You can provide a single AttributeConverterProvider or a chain of ordered AttributeConverterProviders
396
430
through the @DynamoDbBean ' converterProviders' annotation. Any custom AttributeConverterProvider must extend the AttributeConverterProvider
0 commit comments