I am mapping a table using "table-per-hierarchy". When I search by the ID, I am able to get one subclass(SubA) loaded correctly, but get a WrongClassException when trying to load a object which should be loaded to the 2nd subclass(SubB). Below is the hibernate mapping(having removed additional properties) and exception stack. Not sure if this matters but the mappings for individual classes are in separate files.
From the exception it looks like its trying to load Product object instead of SubB, although, it has identified the discriminator correctly as ABC.
With this mapping when I search for a products SubA is found correctly, but I SubB doesnt get picked up correctly with WrongClassException.
Last edited by sgk205 on Fri Oct 08, 2010 1:58 pm, edited 1 time in total.
|