N+1 problem, пути решения в Hibernate