I have super class A which is backed by a table A in the database. I also have 2 sub classes to this super Class namely AB and AC. These classes are not backed by table in the data base. The hibernate mapping files for all the pojos do not indicate that one is base class and other are sub classes.
Now when i run a query of select * from A, Hibernate tries to run select * from AB. Since there is no table AB in the database, i get a sql error.
I did some digging in using Debug mode in eclipse and found that Hibernate actually translates the query to 3 sql queries, one for base class and two for the sub classes and stores it in hashmap or just array.
Why is hibernate trying to get the sub classes when in the mapping files there is no relation ship between these classes.
|