Ebean 在 Play Framework 2 中查找错误的序列名称

2022-09-03 03:06:39

我有一个 ID:

@Column(name = "device")
@GeneratedValue(strategy = GenerationType.AUTO, generator = "device_gen")
@SequenceGenerator(name = "device_gen", sequenceName = "device_id")
@Id
public Integer id;

SequenceGenerator将sequename定义为但尝试保存实体时,我收到错误:关系“public.device_seq”不存在device_id

为什么它在寻找而不是?device_seqdevice_id

我正在使用PostgreSQL


答案 1
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="device_gen")

答案 2

推荐