title: "MultipleBagFetchException: cannot simultaneously fetch multiple bags" when joining three depth table
body: <blockquote>
    <p>org.springframework.dao.InvalidDataAccessApiUsageException:
    org.hibernate.loader.MultipleBagFetchException: cannot simultaneously
    fetch multiple bags: [Order.items, OrderItem.options];</p>
  </blockquote>
  
  <p>Above is an exception i faced when i join three tables like below. </p>
  
  <p>OrderItemOption.java</p>
  
  <pre><code>@Entity
  public class OrderItemOption {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "item_option_id")
    private Long id;
  
    @Column(name = "item_id", nullable = false)
    private Long itemId;
  
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(
        name = "item_id",
        referencedColumnName = "item_id",
        insertable = false,
        updatable = false
    )
    private OrderItem orderItem;
  }
  </code></pre>
  
  <p>OrderItem.java</p>
  
  <pre><code>@Entity
  public class OrderItem {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "item_id")
    private Long id;
  
    @Column(name = "order_id", nullable = false)
    private Long orderId;
  
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(
        name = "order_id",
        referencedColumnName = "order_id",
        insertable = false,
        updatable = false,
        nullable = false
    )
    private Order order;
  
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "orderItem")
    @OrderBy("item_option_id ASC")
    private List&lt;OrderItemOption&gt; options;
  }
  </code></pre>
  
  <p>Order.java</p>
  
  <pre><code>@Entity
  public class Order {
    @Id
    @Column(name = "order_id", nullable = false)
    private Long id;
  
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "order")
    @OrderBy("item_id ASC")
    private List&lt;OrderItem&gt; items;
  }
  </code></pre>
  
  <p>And here's my QueryDSL code to join them at one time.</p>
  
  <pre><code>final QOrder order = QOrder.order;
  final QOrderItem item = QOrderItem.orderItem;
  final QOrderItemOption option = QOrderItemOption.orderItemOption;
  
  from(order)
  .leftJoin(order.items, item).fetchJoin()
  .leftJoin(item.options, option).fetchJoin()
  .where(
      order.id.eq(orderId)
          .and(item.id.in(itemIds))
          .and(option.id.in(optionIds))
  )
  .fetchOne())
  </code></pre>
  
  <p>What i'm trying to do is to get Order object which contains filtered relationship, so that i can access filtered children via order object. 
  and the type of relationship should be a List, not a Set.</p>
  
  <p>for example, order.getItems().get(0).getOptions.get(0)</p>
  
  <p>How can i achieve that goal?</p>