Skip to content

Conversation

@roamariei
Copy link
Contributor

@roamariei roamariei commented Jun 3, 2025

Description

Support TimeToLive attributes in DynamoDb Enhanced Client

Motivation and Context

#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)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • 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
  • I have added tests to cover my changes
  • 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

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

@roamariei roamariei force-pushed the feature/support-timeToLive-attributes-in-dynamodb-enhanced-client branch 3 times, most recently from 28f6637 to 5206b59 Compare June 6, 2025 07:02
@roamariei roamariei marked this pull request as ready for review June 6, 2025 07:02
@roamariei roamariei requested a review from a team as a code owner June 6, 2025 07:02
@anasatirbasa anasatirbasa force-pushed the feature/support-timeToLive-attributes-in-dynamodb-enhanced-client branch from 9b7a52a to 420e193 Compare December 14, 2025 19:33
@anasatirbasa anasatirbasa force-pushed the feature/support-timeToLive-attributes-in-dynamodb-enhanced-client branch from 97468cb to 2291714 Compare January 11, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants