awslabs / awslabs/rds-data-api-client-library-java
Collection of DTOs as input parameters
- Langage dominant
- Java
- Étoiles
- 21
- Forks
- 5
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hi Team,
The library supports var args to pass multiple objects:
```
var account1 = new Account(1, "John");
var account2 = new Account(2, "Mary");
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParamSets(account1, account2)
.execute();
```
If we need to pass Collection we have to call toArray():
```
List accounts = List.of(new Account(1, "John"), new Account(2, "Mary")....);
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParamSets(accounts.toArray())
.execute();
```
Batch saving quite often is used with a list of objects and it would help to avoid extra call toArray().
Could you please add overloaded withParamSets method or a new method to pass java.util.Collection, for instance:
```
List accounts = List.of(new Account(1, "John"), new Account(2, "Mary")....);
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParamCollection(accounts)
.execute();
```
Thank you.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par localiser le point d’entrée withParamSets et sa gestion actuelle des varargs. Examinez ses appelants et ses tests, puis prenez en charge les entrées de type java.util.Collection tout en conservant le comportement actuel des varargs ; le travail est terminé lorsqu’une collection peut être passée directement pour l’exécution par lots.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- database
- Type d'issue
- Fonctionnalité
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100