• Post Reply Bookmark Topic Watch Topic
  • New Topic

Lazy loading of single association in hibernate...  RSS feed

Bin Smith
Ranch Hand
Posts: 514
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have many-to-one relationship between Answer to Topic:

I specified FetchType.LAZY to have topic entity to be loaded only when it is requested. Unfortunately when I do get :

Topic is always fetched in another select by this get method. Hibernate generates two selects - for answer and for topic when this method is called.
Topic is retrieved as hibernate proxy as it should be for lazy loading but why at the same get method?

How to tell hibernate not to select topic entity when doing hibernat get of answer entity?

Thank you!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!