-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate get and simple HQL create different queries
PostPosted: Wed Aug 31, 2011 6:17 am 
Newbie

Joined: Fri Nov 26, 2004 5:11 am
Posts: 5
I have a fairly complex object with a number of relationships. If I try to 'get' the object based upon it's id the query generated is massively slow - joining a large number of tables together in a single query (MySQL database). However - if I do a simple HQL - ...from package.class as cls where cls.id = ? - then Hibernate breaks the query into a number of sensible accesses, and this runs ok.

The relationships are eager, this is our desired tactic - as the resultant object graph is then cached to be available offline. The issue we face is when the cache expires, and is needed to be loaded again.

Is there some documentation to explain the radically different queries which are generated by hibernate for what is effectively the same operation?

Thanks for any assistance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.