我正在使用 JPA Discriminator 注释和单表继承策略和 Hibernate ORM 实现来处理我的应用程序中的不同用户类型。当数据中存在未知的鉴别器值时,Hibernate 会抛出如下异常:
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)
是否有 JPA 方式/注释来忽略未知的鉴别器值?
谢谢,
汤姆