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.
|