I was getting some problem in hibernate with inheritance.
Scenario is,
I have superclass object called Stop and a subclass object called DeadHeadStops extending from Stop object. Both are having their own tables to look into and their own .hbm.xml files.
There is no inheritance at hibernate mapping files level or at tables level, but having only inheritance at object level.
Object Table Hbm.xml
Stop STOP Stop.hbm.xml
DeadHeadStops DEADHEAD_STOPS DeadheadStops.hbm.xml
(extending Stop obj)
Now the problem is, when the application initializes both objects, and when I do session.find(“from Stop s where s.id=”+id), it is looking for subobject table (deadhead_stops) and with id column which is not present in sub object table and gives below error.
I am not sure why it is mapping Super class object with subclass object.
Can some body please help me out in this issue.
Thaks in advance,
Satish.G
|