You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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<Account> 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<Account> 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.
The text was updated successfully, but these errors were encountered:
Hi Team,
The library supports var args to pass multiple objects:
If we need to pass Collection we have to call toArray():
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:
Thank you.
The text was updated successfully, but these errors were encountered: