dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

How to Use FetchMode.JOIN to Fetch Collection

Language: Java, Expertise: Intermediate: See what happens when you annotate an associated collection with FetchMode.JOIN.


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


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;


   
Thanks for your registration, follow us on our social networks to keep up-to-date