Sunday 27 November 2011

JPA: FetchType default values

  • @OneToOne: EAGER
  • @OneToMany: LAZY
  • @ManyToOne: EAGER
  • @ManyToMany: LAZY
As far as I can figure it out (at least it make sense) if a table (class) contains the Foreign Key (FK) then a join is not necessary (except for the ManyToMany case) and therefore it's EAGER :)

References

@OneToOne @OneToMany @ManyToOne @ManyYoMany

No comments:

Post a Comment