Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate relations mapping

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Suppose that i have two hibernate entities, Emp and Dept where Emp has a Dept.

Now, when loading and Emp i want its Dept to be loaded when i ask for it not by default loaded when loading the Emp.

Is that possible ? Or it will be loaded by default ?

Thanks,
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if you defin the association as lazy.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please show me an example ?

This is my case:


Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic