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

DynamoDB Enhanced Client Versioned Record start at 0

Open akiesler opened this issue 1 year ago • 1 comments

This allows for clients using the DynamoDB Versioned Record Extension to start their versions at 0 instead of null thus preventing clients from being required to use the Integer type and instead allowing them to use the int primitive. This change also makes the extension more flexible by allowing clients to set the starting value and incrementing value if they have a use-case to do so.

Motivation and Context

Most developers would expect a version to start at 0 and increment from their instead of having to have a special case where the value must be initialized to null (see https://github.com/aws/aws-sdk-java-v2/issues/3894).

Modifications

Updates the internal logic of VersionedRecordExtension to accept either a null value or a numeric value equal to the starting value.

Testing

Added a unit tests for explicitly setting the version to 0 during initial creation.

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
  • [x] My change requires a change to the Javadoc documentation
  • [x] I have updated the Javadoc documentation accordingly
  • [x] I have added tests to cover my changes
  • [x] All new and existing tests passed
  • [x] 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

akiesler avatar Sep 05 '24 23:09 akiesler

@dagnir could you please review this feature?

akiesler avatar Feb 04 '25 21:02 akiesler

Superseded by https://github.com/aws/aws-sdk-java-v2/pull/6019.

debora-ito avatar Aug 20 '25 01:08 debora-ito