7

I've got a OneToOne relation between two entities. This relation is eager by default, but when logging requests, I only see multiple selects, no join appears. Same thing when forcing eager.

Do you know how to tell eclipselink to use join fetching (like @Fetch(JOIN) in hibernate) ?

Thanks

skaffman
  • 398,947
  • 96
  • 818
  • 769
Jerome VDL
  • 3,376
  • 4
  • 32
  • 33

1 Answers1

9

@JoinFetch

or,

@JoinFetch(JoinFetchType.OUTER)

you can also use,

@BatchFetch

See, http://java-persistence-performance.blogspot.com/2010/08/batch-fetching-optimizing-object-graph.html

You can also set both of these through Query hints instead of always having it enabled.

James
  • 17,965
  • 11
  • 91
  • 146