[PersistenceException:获取序列nextval时出错] [英] [PersistenceException: Error getting sequence nextval]

查看:123
本文介绍了[PersistenceException:获取序列nextval时出错]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试将数据保存到db中的模型时遇到此错误。

i am getting this error while trying to save data into model in db.

@Entity
public class User extends Model {
   @Required
   public String name; 
   @Email
   public String email; 
   @Required @MaxLength(value=10)
   public String username;
   @Required @MinLength(value=4)
   public String password;
   @Id 
   public int id;
}

这是我的班级。

这是我尝试将模型保存到db时的错误。

this is the error while i am trying to save the model into db.

我将非常感谢您的帮助!非常感谢。

i will appreciate any effort for help! many thanks.

编辑:表格结构在这里

table structure is here

推荐答案

我认为使用ebean你必须在物理上命名并注释你的id。您可能还必须告诉它后备音序器的名称(我不记得了)。 显示了如何操作。

I think with ebean you have to physically name and annotate your id. You may also have to tell it the name of the backing sequencer as well (I dont remember). This shows how to do it.

这篇关于[PersistenceException:获取序列nextval时出错]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆