I’m using Hibernate 5.6.15 with JDK 11 LTS.
But I’m getting no results using the following code.
While there is a duplicate record in the database of the same ‘ransactionId’.
I’ve checked the list size which is 0.
public List<Orders> custOrder() {
try ( Session session = HibernateUtil.getSessionFactory().openSession()) {
return session.createQuery("select DISTINCT o from Orders o where o.transid = :transid", Orders.class)
.setParameter("transid", "tlrfx")
.setHint(QueryHints.HINT_PASS_DISTINCT_THROUGH, false)
.getResultList();
}
}