java - JPA ids auto_increment generation -


am using jpa application , when insert different objects database use sequential ids.

for example:

if have table member , table user , when inserting object of type user take id = 1 add object table member take id = 2 .

the problem : imported .sql file database.

then when insert new record application cause exception because use ids added.

how can solve problem ?

you can set start value auto_increment as

alter table tbl auto_increment = 100; 

see also:


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -