我正在使用带有单表继承策略的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方式/注释来忽略未知的鉴别器值?
谢谢,
汤姆