How to handle org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException with single table inheritance?

506 Views Asked by At

I'm using the JPA Discriminator annotation with single table inheritance strategy and a Hibernate ORM implementation to handle the different user types in my application. When an unknown discriminator value is present in the data Hibernate throws an exception like this:

Caused by: org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: Object with id: 3867 was not of the specified subclass: com.example.persistence.model.BaseUser (Discriminator: report); nested exception is org.hibernate.WrongClassException: Object with id: 3867 was not of the specified subclass: com.example.persistence.model.BaseUser (Discriminator: report)

Is there a JPA way/annotation to ignore unknown discriminator values?

Thank you,

Tom

0

There are 0 best solutions below