Hi All,
I have a inheritance mapping between Product and Electronics objects. I have this defined as
single table for subclass model
and using one mapping file for both product and electronics using joined-subclass tag.
After that, I have successfully inserted few records into both the tables, by creating Electronics objects and persisting them.
Now I see two different queries generated by Hibernate, when I try to query Products and Electronics seperately.
If I say
generated query is
from this, I can understand that InnerJoin is used to retrieve Product Name, Product Desc and Product Price, as Electronics
extends Product
But, If I say
generated query is
From the above query, I did not understand why do we need to get Category, as Category is an attribute of Electronics and Product does not have any information about its subclass. Also I did not understand the usage of Case here and why do we need to do a left outer join of electronics.
Can't simply Hibernate query against Product alone, instead of complicating with the usage of joins and unnecessary tables. Please advice, if I need to change anything here.