org.hibernate.Query .iterate() VS .getResultList() query generation
问题 I am using org.hibernate.Query Api to query for result. But i ran into strange problem. This is suppose my query select DISTINCT abc FROM ABC abc where ORDER BY abc.name ASC . I have tested this with Oracle database . let say i have code as below public static List executeQuery(EntityManager em, Query query) { org.hibernate.Query hibernateQuery = query.unwrap(org.hibernate.Query.class); // this piece of code is used to fetch data from cache based on id if(EntityCacheable){ Iterator<Entity> it