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
|