Hibernate use of PostgreSQL sequence does not affect sequence table
I had the same problem. It is related to the id allocating strategies of Hibernate. Whe n you choose GenerationType.SEQUENCE, Hibernate uses HiLo strategy which allocates IDs in blocks of 50 by default. So you can explicitly set allocationSize value like this: @Id @SequenceGenerator(name=”pk_sequence”,sequenceName=”entity_id_seq”, allocationSize=1) @GeneratedValue(strategy=GenerationType.SEQUENCE,generator=”pk_sequence”) @Column(name=”id”, unique=true, nullable=false) public int getId() { return this.id; … Read more