HHH-17372 - Avoid endless recursion in default methods in Selectionquery referring to each other.
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
00c7493aaf
commit
a3f7637585
|
@ -1223,6 +1223,11 @@ public class ProcedureCallImpl<R>
|
|||
return getResultList().stream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream stream() {
|
||||
return getResultStream();
|
||||
}
|
||||
|
||||
public ResultSetMapping getResultSetMapping() {
|
||||
return resultSetMapping;
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ public interface Query<R> extends SelectionQuery<R>, MutationQuery, TypedQuery<R
|
|||
*/
|
||||
@Override
|
||||
default Stream<R> stream() {
|
||||
return getResultStream();
|
||||
return list().stream();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -140,6 +140,10 @@ public interface SelectionQuery<R> extends CommonQueryContract {
|
|||
* stream so that resources are freed as soon as possible.
|
||||
*
|
||||
* @return The results as a {@link Stream}
|
||||
*
|
||||
* @implNote: The default implementation simply returns
|
||||
* <code>{@link #list()}.stream()</code>. Concrete implementations
|
||||
* may provide more efficient implementations.
|
||||
*/
|
||||
default Stream<R> getResultStream() {
|
||||
return stream();
|
||||
|
@ -159,7 +163,7 @@ public interface SelectionQuery<R> extends CommonQueryContract {
|
|||
* @since 5.2
|
||||
*/
|
||||
default Stream<R> stream() {
|
||||
return getResultStream();
|
||||
return list().stream();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -537,6 +537,11 @@ public abstract class AbstractSelectionQuery<R>
|
|||
|
||||
protected abstract ScrollableResultsImplementor<R> doScroll(ScrollMode scrollMode);
|
||||
|
||||
@Override
|
||||
public Stream<R> getResultStream() {
|
||||
return stream();
|
||||
}
|
||||
|
||||
@SuppressWarnings( {"unchecked", "rawtypes"} )
|
||||
@Override
|
||||
public Stream stream() {
|
||||
|
|
Loading…
Reference in New Issue