Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[PersistenceException: Error getting sequence nextval]

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;
}

this is my Class.

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

enter image description here

i will appreciate any effort for help! many thanks.

EDIT: table structure is here enter image description here

like image 252
doniyor Avatar asked Jun 29 '12 11:06

doniyor


1 Answers

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.

like image 96
John Kane Avatar answered Sep 19 '22 08:09

John Kane