Our lifecycle is, I believe, pretty common. We fetch objects from the database, serialize them to JSON and let client-side Javascript unpack it and fill in a form so our users can make changes. The data comes back and is loaded as Java objects by Struts. We re-fetch the original object from Hibernate and do a merge to update with new values.
We have a class, TargetProductGroup. It has a field of type BasicModel. BasicModel in turn has two subclasses, SlagModel and MgOSatModel. In this particular test case, the TargetProductGroup has a MgOSatModel. When we try to call merge, we get this exception:
WrongClassException: Object was not of the specified subclass [BasicModel]: class of the given object did not match class of persistent copy
We do check in the code that the local copy we get from session.find() has an MgOSatModel.