aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

Support timeToLive attributes in DynamoDb Enhanced Client

Open roamariei opened this issue 7 months ago • 0 comments

Description

Support TimeToLive attributes in DynamoDb Enhanced Client

Motivation and Context

https://github.com/aws/aws-sdk-java-v2/issues/4295

Modifications

Added DynamoDbTimeToLiveAttribute annotation, TimeToLive extension to run before every write, added new operations DescribeTimeToLive and UpdateTimeToLive in enhanced client.

Testing

Added unit tests for TimeToLiveExtension, DescribeTimeToLiveOperation, UpdateTimeToLiveOperation and integration tests for update timeToLive with enhanced client in TimeToLiveRecordTest.

Test Coverage Checklist

Scenario Done Comments if Not Done
1. Different TableSchema Creation Methods Not impacted
a. TableSchema.fromBean(Customer.class) [ ]
b. TableSchema.fromImmutableClass(Customer.class) for immutable classes [ ]
c. TableSchema.documentSchemaBuilder().build() [ ]
d. StaticTableSchema.builder(Customer.class) [ ]
2. Nesting of Different TableSchema Types Not impacted
a. @DynamoDbBean with nested @DynamoDbBean as NonNull [ ]
b. @DynamoDbBean with nested @DynamoDbImmutable as NonNull [ ]
c. @DynamoDbImmutable with nested @DynamoDbBean as NonNull [ ]
d. @DynamoDbBean with nested @DynamoDbBean as Null [ ]
e. @DynamoDbBean with nested @DynamoDbImmutable as Null [ ]
f. @DynamoDbImmutable with nested @DynamoDbBean as Null [ ]
3. CRUD Operations
a. scan() [ ]
b. query() [ ]
c. updateItem() [ ]
d. putItem() [x]
e. getItem() [x]
f. deleteItem() [ ]
g. batchGetItem() [ ]
h. batchWriteItem() [ ]
i. transactGetItems() [ ]
j. transactWriteItems() [ ]
4. Data Types and Null Handling Not impacted
a. top-level null attributes [ ]
b. collections with null elements [ ]
c. maps with null values [ ]
d. conversion between null Java values and AttributeValue [ ]
e. full serialization/deserialization cycle with null values [ ]
5. AsyncTable and SyncTable
a. DynamoDbAsyncTable Testing [ ]
b. DynamoDbTable Testing [x]
6. New/Modification in Extensions
a. Tables with Scenario in ScenarioSl No.1 (All table schemas are Must) [x]
b. Test with Default Values in Annotations [x]
c. Combination of Annotation and Builder passes extension [x]
7. New/Modification in Converters Not impacted
a. Tables with Scenario in ScenarioSl No.1 (All table schemas are Must) [ ]
b. Test with Default Values in Annotations [ ]
c. Test All Scenarios from 1 to 5 [ ]

Screenshots (if appropriate)

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)

Checklist

  • [x] I have read the CONTRIBUTING document
  • [x] Local run of mvn install succeeds
  • [x] My code follows the code style of this project
  • [ ] My change requires a change to the Javadoc documentation
  • [ ] I have updated the Javadoc documentation accordingly
  • [x] I have added tests to cover my changes
  • [x] All new and existing tests passed
  • [ ] I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • [ ] My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • [x] I confirm that this pull request can be released under the Apache 2 license

roamariei avatar Jun 03 '25 09:06 roamariei