aws / aws/aws-sdk-java-v2

Enhanced DynamoDB annotations are incompatible with Lombok

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

Descrizione

## Describe the Feature
Lombok is a popular system for reducing boilerplate code, especially in data-centric objects such as database entries. By annotating the class and/or member variables, it autogenerates setters and getters. This creates problems with enhanced dynamodb, because the annotations such as DynamoDbAttribute and DynamoDbPartitionKey cannot be applied to member variables, only to setter/getter functions, and the setter/getter function is not present in the source code. In DynamoDbMapper (from AWS SDK v1), annotations could be applied to functions or member variables, so Lombok worked well. It would be great if the enhanced DynamoDb library could work the same way.

## Is your Feature Request related to a problem?
I'm always frustrated when I cannot use the new SDK because it is incompatible with other software that my development team depends on.

## Proposed Solution
Ideally the annotations can be applied to member variables in the same manner that the SDKv1 dynamoDbMapper annotations could.
As a second-best alternative, it could allow the annotations to be applied to member variables, but ignore them; with a little work, Lombok can be set to copy annotations from member variables to the setters and getters.

## Describe alternatives you've considered
The alternative is to write explicit setters and getters for all dynamo-annotation values. This would be a significant pain point, however; we will probably prefer to stay with SDKv1.

## Additional Context
Lombok annotations are as follows:
```
@Setter
@Getter
public class Customer {
private String id;

private String email;

private Instant registrationDate;
}
```
Functions "setId(String)", "getId()", etc. are all generated automatically, so there is no way to get the annotations onto them.

- [ ] I may be able to implement this feature request

## Your Environment

* AWS Java SDK version used: 2.13.47
* JDK version used: Java 11
* Operating System and version: Ubuntu (on EC2), AWS Lambda (whatever version of Linux that is)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Non vengono indicati file o test. Inizia leggendo la gestione delle annotazioni avanzate di DynamoDB e confrontala con il comportamento di DynamoDbMapper descritto nell’issue, usando come caso di riproduzione l’esempio dell’accessor generato da Lombok. Il lavoro dovrebbe considerarsi concluso quando le annotazioni avanzate di DynamoDB possono essere usate con getter e setter generati da Lombok, oppure quando è supportata l’alternativa indicata delle annotazioni sui campi.

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

Valutazione

Stack tecnologico
java
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
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.