-->
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: Polymorphic Query Optimization?
PostPosted: Mon Dec 27, 2010 10:04 pm 
Beginner
Beginner

Joined: Tue Mar 17, 2009 12:19 pm
Posts: 22
I have a OneToMany relationship between two entities and when invoking a method on the lazy loaded Parent object after calling getParent() from the Child, Hibernate (3.5.6GA) invokes a huge polymorphic query with all the left outer joins. The Parent does have over 30 different entity types in my system, so this makes sense that Hibernate needs the query to determine the type. However, I do have a discriminator column but Hibernate doesn't seem to be able to take advantage of that in order to make the query more efficient.

What can I do to improve this query? The thing is, in this case, I know the Parent can only be one of a few different types. Is there something I can extend (one of the Tuplizer classes?) to put in a little logic to simplify the query?

Thanks!


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.