awslabs / awslabs/rds-data-api-client-library-java
Collection of DTOs as input parameters
- Ngôn ngữ chính
- Java
- Star
- 21
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xác định entry point withParamSets và cách xử lý varargs hiện có. Xem xét các caller và test của nó, sau đó hỗ trợ input kiểu java.util.Collection trong khi vẫn giữ nguyên hành vi varargs hiện tại; hoàn tất khi có thể truyền trực tiếp một collection để thực thi theo lô.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- database
- Loại issue
- Tính năng
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100