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

时间:2012-04-24 12:25:19

标签: java postgresql orm playframework-2.0 ebean

我有一个id:

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

SequenceGenerator将sequenceName定义为device_id但是尝试保存实体我得到错误:关系“public.device_seq”不存在

为什么要寻找device_seq而不是device_id

我正在使用PostgreSQL

1 个答案:

答案 0 :(得分:1)

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