Ebean looks for wrong sequence name in Play Framework 2

爱⌒轻易说出口 提交于 2019-12-23 07:20:19

问题


I have an id:

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

SequenceGenerator defines the sequenceName as device_id but trying to save an entity I get the error: relation "public.device_seq" does not exist.

Why is it looking for device_seq instead of device_id?

I'm using PostgreSQL


回答1:


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


来源:https://stackoverflow.com/questions/10297778/ebean-looks-for-wrong-sequence-name-in-play-framework-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!