aws / aws/aws-sdk-java-v2

Persist-only property support for DynamoDB Enhanced client

Open
#3,913 1 comment 1 reaction 0 assignees View on GitHub
dynamodb-enhanced feature-request p3
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

### Describe the feature

The Enhanced client should identify JavaBeans properties based on getter methods. When a setter method is not present, the client should persist the property into DynamoDB but should not attempt to set the property on read. (If necessary, an explicit directive to do this such as Jackson's `@JsonProperty(access)` would be okay.)

### Use Case

I have a table with a large number of derived properties for indexing. Currently, [the Enhanced client fails to correctly identify properties that have only getter methods and not setter methods](https://davidagood.com/dynamodb-enhanced-client-java-missing-setters/). As the use of derived properties to paste together main properties is the standard method of creating indexes for DDB, it would be helpful not to have to include dummy setters.

### Proposed Solution

Modify `BeanTableSchema#isMappableProperty` not to exclude properties without setters, and allow missing setters to be interpreted as "no-op".

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS Java SDK version used

2.19.25

### JDK version used

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

### Operating System and version

Gentoo Linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.