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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -