I think your problem is your id generation type - GenerationType.IDENTITY. Usually when using identity a special database column is used to generate the id. The id is not generated until the data is inserted into the database and the id itself is not available to the entity until after commit. However, Bean Validation occurs on the pre-persist callback using the current state of the entity. This will fail, because the id is still null
.
I probably would just change the generation type.