如何在子类中重写@GeneratedValue

时间:2013-11-19 14:11:43

标签: java hibernate hibernate-annotations

如果我在超类中只有GeneratedValue,并且如果我在子类中有特定的生成器类型,我该如何覆盖此功能。

SUPER CLASS:

@Id
@GeneratedValue
private Long id;

SUB CLASS:

@Id
@SequenceGenerator(name = "a", sequenceName = "a")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "a")
private Long id;

0 个答案:

没有答案