title: Hibernate throws MultipleBagFetchException - cannot simultaneously fetch multiple bags
body: <p>Hibernate throws this exception during SessionFactory creation:</p>
  
  <blockquote>
    <p>org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags</p>
  </blockquote>
  
  <p>This is my test case:</p>
  
  <p><strong>Parent.java</strong></p>
  
  <pre><code>@Entity
  public Parent {
  
   @Id
   @GeneratedValue(strategy=GenerationType.IDENTITY)
   private Long id;
  
   @OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
   // @IndexColumn(name="INDEX_COL") if I had this the problem solve but I retrieve more children than I have, one child is null.
   private List&lt;Child&gt; children;
  
  }
  </code></pre>
  
  <p><strong>Child.java</strong></p>
  
  <pre><code>@Entity
  public Child {
  
   @Id
   @GeneratedValue(strategy=GenerationType.IDENTITY)
   private Long id;
  
   @ManyToOne
   private Parent parent;
  
  }
  </code></pre>
  
  <p>How about this problem? What can I do?</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>OK, the problem I have is that another "parent" entity is inside my parent, my real behavior is this:</p>
  
  <p><strong>Parent.java</strong></p>
  
  <pre><code>@Entity
  public Parent {
  
   @Id
   @GeneratedValue(strategy=GenerationType.IDENTITY)
   private Long id;
  
   @ManyToOne
   private AnotherParent anotherParent;
  
   @OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
   private List&lt;Child&gt; children;
  
  }
  </code></pre>
  
  <p><strong>AnotherParent.java</strong></p>
  
  <pre><code>@Entity
  public AnotherParent {
  
   @Id
   @GeneratedValue(strategy=GenerationType.IDENTITY)
   private Long id;
  
   @OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
   private List&lt;AnotherChild&gt; anotherChildren;
  
  }
  </code></pre>
  
  <p>Hibernate doesn't like two collections with <code>FetchType.EAGER</code>, but this seems to be a bug, I'm not doing unusual things...</p>
  
  <p>Removing <code>FetchType.EAGER</code> from <code>Parent</code> or <code>AnotherParent</code> solves the problem, but I need it, so real solution is to use <code>@LazyCollection(LazyCollectionOption.FALSE)</code> instead of <code>FetchType</code> (thanks to <a href="https://stackoverflow.com/users/203907/bozho">Bozho</a> for the solution).</p>