java - @SequenceGenerator is not working -
today got strange behavior. have declared model primary key uses @sequencegenerator
:
@sequencegenerator(name="emp_seq_gen", sequencename="emp_seq") @id @generatedvalue(generator="emp_seq_gen_gen") @column(name = "emp_id", unique = true, nullable = false, precision = 22, scale = 0) public long getempid() { return this.empid; }
it works locally doesn't work on server. have connected same database both environments.
i think @generatedvalue should @generatedvalue(strategy = generationtype.sequence, generator = "emp_seq_gen").
Comments
Post a Comment