关于实体继承解决方式
@MappedSuperclass
public class AbstractEntity{
//子类都需要的字段可写在这里
@Column(length = 6)
private String name;
... ...
}
@Entity
@Table(name = "child")
public class ChildEntity extends AbstractEntity{
... ...
}
主键策略可参考:
https://blog.csdn.net/MJZ_CSDN/article/details/45024499?utm_source=blogxgwz1
https://blog.csdn.net/cooledi/article/details/78182135?utm_source=blogxgwz1