Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

one to one is not Lazy?

 
Jana reddyMadam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can we make One-to-One relation as Lazy with JPA and Hibernate instead of always making One to one as Eager fetch.

Please explain.

Thanks
Jana
 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, we can. Just add fetch=FetchType.LAZY to @OneToOne.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic