Hi,
I would like to map several classes to the same DB table, in order to implement different "views" of a business object.
But I'm running into a problem: I keep getting Exceptions like this:
net.sf.hibernate.WrongClassException: Object with id: 15 was not of the specified subclass: de.ovsag.cool.data.person.model.PersonHandle (loaded object was of wrong class)
I think what's happening is this: the business object in question was already loaded in the same session as a different class, Person. When Hibernate later tries to load an object of class PersonHandle mapped to the same DB table and which has the same ID, it returns the already loaded object, which has the wrong class.
Is there any way to work around this problem?
|