aws / aws/aws-sdk-java-v2

DynamoDB Enhanced to support immutable Kotlin data classes

Aperta
#2,096 11 commenti 49 reazioni 0 assegnatari Vedi su GitHub
dynamodb-enhanced feature-request kotlin p2
Lingua principale
Java
Stelle
2.6k
Fork
1k
Merge medio
2g 9h
PR unite (30g)
51

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

L’issue nomina il DynamoDB Enhanced mapper, ma non indica alcun file sorgente o test. Inizia individuando la gestione delle data class di Kotlin nel mapper e confrontala con l’Example(val name: String) immutabile fornito. Il lavoro è completato quando una data class immutabile può essere mappata da DynamoDB senza un costruttore senza parametri, il noarg plugin o proprietà var mutabili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, kotlin
Ambito
database
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.