Many returned records cause stackoverflow with Hibernate
- by mimi law
If there are many return records from DB. It will get stackoverflow problem.
User is a class, which has a one to many relationship (to 3 other classes). When I print out the SQL, i found that the system runs the same query many time to get the data from DB. Does anyone know what the problem is?
result.addAll(getCurrentSession().createCriteria(User.class)
.add(Restrictions.ilike("name", "tom", MatchMode.ANYWHERE))
.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)
.list());