wuruize888
2019-10-01 20:33
采纳率: 100%
浏览 383
已采纳

springboot jpa继承问题,谢谢解答。

@Entity(name = "Account")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public static class Account {

    @Id
    private Long id;

    private String owner;

    private BigDecimal balance;

    private BigDecimal interestRate;


}

@Entity(name = "DebitAccount")
public static class DebitAccount extends Account {

    private BigDecimal overdraftFee;


}

最终在数据库中生成了Account表,DebitAccount表,能否不生成Account表,只要DebitAccount表,谢谢各位帮忙

3条回答 默认 最新

相关推荐 更多相似问题