When attempting to process a query using query.getResultStream() if the BatchEntitySelectFetchInitializer is to be used to fetch an object, the object doesn't get fetched and is null as it only gets fetched during endLoading which only gets called after the stream is closed. Test cases attached shows it worked in Hibernate ORM 5 and in ORM 6 query.getResultList() works as endLoading gets called but in query.getResultStream() it doesn't. |