【发布时间】:2020-06-09 11:25:30
【问题描述】:
使用 Hibernate 和 Spring Boot 让抽象类 B 继承的抽象类 A 由类 C 继承的正确方法是什么?
@Entity
@Inheritance
abstract class A{}
@Entity
@Inheritance
abstract class B extends A{}
@Entity
@Inheritance
final class C entends B{}
问题是我有一个异常“原因:org.postgresql.util.PSQLException: ERROR: column something(from class A) does not exist”。我的注释错了吗?
【问题讨论】:
-
你试过
@MappedSuperclass吗?此外,实体不应该是final
标签: java hibernate jpa inheritance annotations