aspose file tools*
The moose likes Object Relational Mapping and the fly likes Lazy loading of single association in hibernate... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Lazy loading of single association in hibernate..." Watch "Lazy loading of single association in hibernate..." New topic
Author

Lazy loading of single association in hibernate...

Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 481
    
    1

Hello!

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!


True person is moral, false is right!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lazy loading of single association in hibernate...
 
Similar Threads
Problems mapping entities of single_table inheritance...
eager fetching of lazy formulas via criteria api
FetchType.LAZY and FetchMode.JOIN
annotation for lazy loading
JPA 2.0 Criteria, fetching whole entity graph