0

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);
jessieloo
  • 1,759
  • 17
  • 24
  • Looks like a bug to me. Please create an issue in the issue tracker(https://hibernate.atlassian.net) with a test case(https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-5/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java) that reproduces the issue. – Christian Beikov Sep 30 '22 at 12:30

0 Answers0