diff --git a/src/main/java/dev/struchkov/example/hibernate/nbfe/fix/FixProblem.java b/src/main/java/dev/struchkov/example/hibernate/nbfe/fix/FixProblem.java index 6750387..4e8ead5 100644 --- a/src/main/java/dev/struchkov/example/hibernate/nbfe/fix/FixProblem.java +++ b/src/main/java/dev/struchkov/example/hibernate/nbfe/fix/FixProblem.java @@ -4,6 +4,7 @@ import dev.struchkov.example.hibernate.nbfe.fix.domain.Post; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.Persistence; +import org.hibernate.annotations.QueryHints; import java.util.List; @@ -21,6 +22,7 @@ public class FixProblem { where p.id between :minId and :maxId""", Post.class) .setParameter("minId", 1L) .setParameter("maxId", 50L) + .setHint("PASS_DISTINCT_THROUGH", false) .getResultList(); posts = entityManager.createQuery(""" @@ -29,6 +31,7 @@ public class FixProblem { left join fetch p.tags t where p in :posts""", Post.class) .setParameter("posts", posts) + .setHint("PASS_DISTINCT_THROUGH", false) .getResultList(); final long finishTime = System.currentTimeMillis();