[hibernate-dev] Stream result change proposal

Vlad Mihalcea mihalcea.vlad at gmail.com
Tue Jun 7 05:50:16 EDT 2016


Hi,

While writing documentation for the new 5.2 Query.stream() API, I realized
that we don't return a Stream<T>, but a Stream<Object[]> which could
confuse users.
This is because ScrollableResultsImpl does something like this:

if ( result != null && result.getClass().isArray() ) {
   currentRow = (Object[]) result;
}
else {
   currentRow = new Object[] {result};
}

The result is the actual entity that we queries, while the currentRow
is an Object[].

I think we might want to change the stream result so that we return
the result for each available entry.

Vlad


More information about the hibernate-dev mailing list