title: Hibernate : fetch lazy collection with HQL
body: <p>I have two large tables (> 100 million rows each), let's call them Parent and Child (Parent with a lazy one to many relation to Child). The query is very slow when I use a join fetch 
  and I also get a hibernate warning "HH000104 firstresult maxresults specified with collection fetch applying in memory" because I use a limit.</p>
  
  <p>So I am trying to get the data in two separated queries:<br>
  - first query gets all parents with a limit<br>
  - second query gets children with parent.id in the parent ids found by the first query<br></p>
  
  <p>This solution performs very well, however hibernate does not aggregate the children with their parents, although the two queries are executed in the same session.</p>
  
  <p>I wonder if there is a way to achieve this using HQL or some java code:
  - I do not wish to use the criteria API (I would need to rewrite many queries and I find criteria API queries hard to maintain)
  - I do not want to change the Parent/Child relation to EAGER/BATCH because I would not be able to query the Parent without the Child</p>
  
  <p>Any idea ?</p>