我有一个 JOOQ 查询,我想避免同时实现所有记录。(但是,我可以共同实现从它们创建的所有 bean 对象。)
我有以下简单的方法来加载数据:
public List<CustomerInfo> getCustomers() {
return dslContext
.selectFrom(CUSTOMER)
// <-- note the missing .fetch()
.stream()
.map(CustomerInfo::new)
.collect(Collectors.toList());
}
这会在任何情况下导致 JDBC 连接泄漏吗?(例如 中的异常CustomerInfo::new
)