I have created a sequence in the database (PostgreSQL) and I have the following annotations in the domain model. I am using JPA. However, when I invoke the web service (REST) without an id in the object that I want to create it throws a constraint error. However shouldn't it use a value from the sequence below?
@Id
@SequenceGenerator(name = "user_seq", sequenceName = "user_seq", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "user_seq")
private int id;
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "id" violates not-null constraint