This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

one to one is not Lazy?  RSS feed

 
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
 
Bin Smith
Ranch Hand
Posts: 514
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
Boost this thread!