Have a Spring boot with Spring Data JPA. Postgres DB.
General entity:
@Entity
@Table
class Entity {
@Id
@GeneratedValue
private int id;
}
when I try to make an entry with a specified id
value, as a result I see that it is ignored and generated by @GeneratedValue
.
How to overcome this?
Posting the solution, to which I came after doing a debug of the whole persist process (not stating that this is the right way, but I literally didn't find any spot of "maybe I configured something wrong"):
and the entity: