-->
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: Single Table Inheritance with Secondary Tables
PostPosted: Tue Dec 15, 2009 10:29 am 
Newbie

Joined: Thu Mar 19, 2009 11:07 am
Posts: 6
Hello all,

first of all, sorry if I ask a question that was already answered but it seems that the search of the forum does not work. At least I did not get an answer after the request was submitted.

I have an inheritance tree that is mapped with single table inheritance. The subclasses use secondary tables to store the information. Now I have the following problem:

Imagine I have an abstract class A that is mapped to table A and the classes B and C that inherit from A and both store information in the same secondary table B. If I configure the FetchMode.SELECT I end up with a select statement for each entity in table A, basically the n+1 selects problem.

If I use FetchMode.JOIN I will have two joins to the secondary table, one for each subclass. So, I wonder if there is any way to solve this with one join. Maybe by introducing a concrete superclass for B and C? Unfortunately, reconfiguring the DB-Schema is not an option at the moment. This is a problem for me since in my scenario this sums up to 21 joins :(

Thanks in advance for every help!
Greets,
Patrick


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.