I'm new to Hibernate (using 5.6) and was exploring these alternatives to getSingleResult() while using an entity graph. When I use this, it seems to disregard the entity graph based on the logged sql
query.setHint("javax.persistence.fetchgraph", graph).getResultStream().findFirst().orElse(null);
However, this does use the entity graph. I'm curious as to why?
query.setHint("javax.persistence.fetchgraph", graph).getResultList().stream().findFirst().orElse(null);