aws / aws/aws-sdk-java-v2

DynamoDB Enhanced to support immutable Kotlin data classes

Open
#2,096 11 comments 49 reactions 0 assignees View on GitHub
dynamodb-enhanced feature-request kotlin p2
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

In Kotlin your goal is to use data classes as immutable. With the current mapper this is not possible. You have to add an parameter less constructor to the class (noargs plugin) and all fields has to be changeable (var's instead val's)

Example:
`data class Example(val name:String)` and not `data class Example(var name:String)`

## Describe the Feature
The DynamoDB Enhanced mapper should call the constructor with all attributes read from the dynamodb.

## Is your Feature Request related to a problem?
You can't use immutable data classes and you have to use the norags plugin.

## Describe alternatives you've considered
Use var's instead of val's and use norags plugin:
```
plugins{
id("org.jetbrains.kotlin.plugin.noarg") version "1.4.10"
}
noArg {
annotation("software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean")
}
```

## Your Environment

* AWS Java SDK version used: 2.15.7
* JDK version used: 11
* Operating System and version: Mac 10.15.7

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.