Table: "ID" INTEGER DEFAULT nextval('zakazchik_id_seq'::regclass) NOT NULL,
Entity:
@Id @Column(name = "\"ID\"", unique = true) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "\"zakazchik_seq_gen\"") @SequenceGenerator(name = "\"zakazchik_seq_gen\"", sequenceName = "\"zakazchik_id_seq\"") private Integer id; When inserting a new line writes:
ERROR SqlExceptionHelper:131 - ERROR: duplicate key value violates unique constraint "zakazchik_new_new1_new_pk_zakaz" Подробности: Key ("ID")=(730) already exists. That's right, 730 id is already taken ... and so on until 743. Through hibernate, I just now started working, before that everything was through jdbc with a creepy sql query collector.
Why did he start assigning old id from 700, I told him zakazchik_id_seq ?
select last_value from zakazchik_id_seq? Also try adding@Columnto the annotation -updatable = false, nullable = falseand to the annotationSequenceGenerator-allocationSize=1- ChubatiyallocationSize=1- Chubatiy