i get this error when trying to Persist a customer Entity in my web application using netbeans with the default glassfish server persistence provider eclipselink(JPA2.0)
SEVERE: javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'. Please refer to embedded ConstraintViolations for details.
the table that i want to write to has the following colums
id ==> primarykey auto increment not null int
name == varchar(45) not null
phone ==> varchar(19)
balance ==> bigdecimal(6,2) not null default(0.00)
in my addNewCustomer i only need to set name, phone and nationalIdNo only
this is my code
why am i getting this error?
and how do you do a bean validation?
Joined: Oct 21, 2008
My guess would be that you have validation rules emdedded in your Customer class and the validation fails before persisting.
But it is hard to say without seeing the Customer