Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit f21f4f5

Browse files
authored
Add the description about the openStream method (#15)
1 parent 9347dca commit f21f4f5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/criteria-api.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ The NativeSql DSL supports the following methods:
316316

317317
* mapStream
318318
* collect
319+
* openStream
319320

320321
.. code-block:: java
321322
@@ -332,6 +333,14 @@ The NativeSql DSL supports the following methods:
332333
Map<Integer, List<Employee>> map2 =
333334
nativeSql.from(e).collect(groupingBy(Employee::getDepartmentId));
334335
336+
// The openStream method returns a stream.
337+
// You MUST close the stream explicitly.
338+
try (Stream<Employee> stream = nativeSql.from(e).openStream()) {
339+
stream.forEach(employee -> {
340+
// do something
341+
});
342+
}
343+
335344
These methods handle the stream that wraps a JDBC ResultSet.
336345
So they are useful to process a large ResultSet effectively.
337346

0 commit comments

Comments
 (0)