Hibernate : Why FetchType.LAZY-annotated collection property eagerly loading?
<p>I tried to implement simple <code>one-to-many</code> association. after inspecting the item object with debugging mode, I found that <code>List&lt;Bid&gt; bids</code> already loaded. But <code>List&lt;Bid&gt;</code> bids property is annotated with <code>FetchType.LAZY</code>. some books and web pages claim that <code>FetchType.LAZY</code> is a hint JPA providers accept or reject. But I wonder on what condition JPA providers ignore <code>FetchType.LAZY</code>. Thank you in advance.</p>
<pre><code>@Entity
@Table(name = &quot;ITEM&quot;)
public class Item implements Serializable {

    @Id
    private Long id = null;

    private String name;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = &quot;SELLER_ID&quot;, nullable = false)
    private User seller;

    @OneToMany(mappedBy = &quot;item&quot;, fetch = FetchType.LAZY)
    private List&lt;Bid&gt; bids;

    /**
     * No-arg constructor for JavaBean tools.
     */
    public Item() {}

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public User getSeller() {
        return seller;
    }

    public void setSeller(User seller) {
        this.seller = seller;
    }

    @Override
    public String toString() {
        return &quot;Item{&quot; +
                &quot;id=&quot; + id +
                &quot;, name='&quot; + name + '\'' +
                &quot;, seller=&quot; + seller +
                &quot;, bids=&quot; + bids +
                '}';
    }
}
</code></pre>

<pre><code>@Entity
@Table(name = &quot;BID&quot;)
public class Bid implements Serializable {

    @Id @GeneratedValue
    @Column(name = &quot;BID_ID&quot;)
    private Long id = null;

    @ManyToOne
    @JoinColumn(name = &quot;ITEM_ID&quot;, nullable = false, updatable = false, insertable = false)
    private Item item;

    @ManyToOne
    @JoinColumn(name = &quot;BIDDER_ID&quot;, nullable = false, updatable = false)
    private User bidder;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }

    public User getBidder() {
        return bidder;
    }

    public void setBidder(User bidder) {
        this.bidder = bidder;
    }

    @Override
    public String toString() {
        return &quot;Bid{&quot; +
                &quot;id=&quot; + id +
                &quot;, bidder=&quot; + bidder +
                '}';
    }
}
</code></pre>

<pre><code>private static void itemSeller(EntityManager em) {

    Item item = em.find(Item.class, 1L);
    System.out.println(&quot;hello&quot;);

}
</code></pre>
<p>EDIT : I put break point at the statement <code>System.out.println(&quot;hello&quot;)</code>. I inspected the item object. See the picture :
<a href="https://i.stack.imgur.com/7aiD0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7aiD0.png" alt="enter image description here" /></a></p>