By using the openStream method, you can process the data associated with the ResultSet one record at a time, reducing memory consumption. Make sure to always close the opened Stream.
Employee_ e = new Employee_();
try (Stream<Employee> stream = nativeSql.from(e).openStream()) {
stream.forEach(employee -> {
// do something
});
}
By using the
openStream
method, you can process the data associated with theResultSet
one record at a time, reducing memory consumption. Make sure to always close the openedStream
.