|
Hello.
We've just discovered how Hibernate uses (or does not, in reality) the discriminator column to handle polymorphic requests on joined strategy inheritance, and the wrong generated code.
After reading this post and the HHH-6911, we've tested adding the property "hibernate.discriminator.ignore_explicit_for_joined=true". This makes the code work, but Hibernate still generates "huge" queries, building a join on the tables for all the classes of the hierarchy to determine the real type from the presence of the primary key in the matching table. In our case, about 20 tables while the query doesn't need to actually retrieve data or return objects.
The query is something like this :
We expected a SQL query like :
where "kind" is the discriminator column, and not a 20 tables "join" or a 20 lines "case"...
As said before, this works, but unfortunately this also leads to performance issues.
Is there another workaround (another property ?) to make Hibernate actually use the discriminator column ?
Thanks.
Regards.
|