Your application uses the Java Persistence API to access a database. This application must reject
adding an instance to the database if it does NOT pass validation tests for values of two
persistence properties. The database contains some data that will NOT pass such validation. Only
the new records must be validated. Which option will achieve this behavior?
Add validation logic to the setter methods for each property.
Add the PrePersist callback method with all of the validation logic.
Add the PostPersist callback method with all of the validation logic.
Add PrePersist and PreUpdate callback methods with all of the validation logic.