title: Hibernate : Do not Fetch Association in criteria APi
body: <p>I am trying to fetch an entity using criteria API.</p>
  
  <p>Here is what header entity looks like</p>
  
  <pre><code>public class Header{
      @OneToMany(mappedBy = "header", cascade = CascadeType.ALL)
      @LazyCollection(LazyCollectionOption.FALSE)
      @JsonManagedReference
      private List&lt;Item&gt; items;
  }
  </code></pre>
  
  <p>Can I restrict not to load items? I tried this. Please Help</p>
  
  <pre><code>Criteria criteria = session.createCriteria(Header.class);
  criteria.add(Restrictions.eq("id", id));
  criteria.setFetchMode("header.items",FetchMode.LAZY);
  return (Header) criteria.uniqueResult();
  </code></pre>
  
  <p><strong>logged the mysql queries it looks like</strong> </p>
  
  <pre><code>/* MyService Health Check */ SELECT 1
          3 Query /* criteria query */ select this_.id as id1_0_0_, this_.created_at as created_2_0_0_, this_.updated_at as updated_3_0_0_, this_.created_by as created_4_0_0_, this_.description as descript5_0_0_, this_.due_date as due_date6_0_0_, this_.party_id_from as party_id7_0_0_, this_.party_id_to as party_id8_0_0_, this_.reference_id as referenc9_0_0_, this_.sub_type as sub_typ10_0_0_, this_.total_amount_with_tax as total_a11_0_0_, this_.total_amount_without_tax as total_a12_0_0_, this_.type as type13_0_0_ from headers this_ where this_.id=1
          3 Query SHOW WARNINGS
          3 Query select items0_.header_id as header_i7_0_0_, items0_.id as id1_2_0_, items0_.id as id1_2_1_, items0_.created_at as created_2_2_1_, items0_.updated_at as updated_3_2_1_, items0_.amount as amount4_2_1_, items0_.header_id as header_i7_2_1_, items0_.ignore_reco as ignore_r5_2_1_, items0_.type as type6_2_1_ from items items0_ where items0_.header_id=1
  </code></pre>