I have an issue very similar to that in 4.3.7.Final
Using 'scroll()', Query and Criteria are not returning the same results.
Using Query, the collection is filled correctly: String hqlJoinFetchTest = "from ModelA a " + "left outer join fetch a.modelb as b"; Query query = sessionFactory.getCurrentSession().createQuery(hqlJoinFetchTest);
Using Criteria, the collection only contains the first element (and parents are duplicated): Criteria searchCriteria = session.createCriteria(ModelA.class); searchCriteria.setFetchMode("modelb", FetchMode.JOIN);
|