title: Hibernate join children list with parent entity in one query
body: <p>So I have a <code>ManyToOne</code> relation between these two tables:<br></p>
  
  <pre><code>@Entity
  public class Parent{
      @Id 
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
  
      @OneToMany(cascade = CascadeType.ALL, mappedBy="parent", orphanRemoval=true)
      @OrderBy(clause="id DESC")
      private List&lt;Children&gt; childs= new ArrayList&lt;Children&gt;();
  }
  
  @Entity
  public class Children{
          @Id 
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          private int id;
  
          @ManyToOne
          private Parent parent;
  
  }
  </code></pre>
  
  <p>So what I want to do is to get <code>List&lt;Parent&gt;</code> that contains it's childrens in one query, I mean I don't want to use the lazy loading, so I want to Join the childrens to the parents in one query and get List of parents.<br>
  How can I reach that using hibernate's Criteria or HQL ?<br>
  I have used this query but it's not giving me what I want :<br></p>
  
  <pre><code>List&lt;Parent&gt; list = session.createQuery("SELECT p FROM Parent p JOIN p.childs c ORDER BY p.id DESC").list();
  </code></pre>
  
  <p>this gives me <code>List&lt;Parent&gt;</code> but when I loop through it I get duplicated parent when this parent has more than one children !!</p>