title: Hibernate fetch join -> cannot fetch multiple bags
body: <p>Problem is i have two bags in my entity which i would like to display in my jsf frontend (Spring in the back so no lazy loading). So i have to eagerly fetch them to display the information in a list like this:</p>
  
  <ul>
  <li>Point 1 (Label 1, Label 2) (Tag1 ... Tag n)</li>
  <li>Point 2 (Label 3, Label 4) (Tag1 ... Tag n)</li>
  </ul>
  
  <p>Putting both Lists to eager didn't work. So i tried my luck with a fetch join. It allowed me to fetch one list, but when i added the second list i get the known "cannot fetch multiple bags" error. </p>
  
  <p>Can Hibernate handle two fetch joins in a query?</p>
  
  <pre><code>public class PointOfInterest
   @OneToMany(mappedBy="poi")
  private List&lt;PointOfInterestLabel&gt; labels = new ArrayList&lt;PointOfInterestLabel&gt;();
  
  @ManyToMany
  private List&lt;Tag&gt; tags = new ArrayList&lt;Tag&gt;();
  </code></pre>
  
  <p>My fetch join:</p>
  
  <pre><code>SELECT DISTINCT p from PointOfInterest p 
          left join fetch p.labels 
          left join fetch p.tags WHERE p.figure = :figure
  </code></pre>
  
  <p>On startup the creation of my hibernate factory fails with:</p>
  
  <pre><code>Caused by: org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags
      at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:94)
      at org.hibernate.loader.hql.QueryLoader.&lt;init&gt;(QueryLoader.java:123)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:206)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
      at org.hibernate.engine.query.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:101)
      at org.hibernate.engine.query.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:80)
      at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98)
      at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:557)
      at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:422)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
      at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:883)
      ... 55 more
  </code></pre>