How to Use FetchMode.JOIN to Fetch Collection

By annotating an associated collection with FetchMode.JOIN we force it to be loaded EAGER:

@OneToMany(fetch = FetchType.LAZY)@Fetch(FetchMode.JOIN)private List = new ArrayList();

Or:

@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "foo_id") @Fetch(FetchMode.JOIN) private Foo foo;
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: