Which option will achieve this behavior?

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?

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?

A.
Add validation logic tothesetter methods for each property.

B.
AddthePrePersist callbackmethodwithallofthevalidation logic.

C.
Addthe PostPersist callback methodwithall ofthevalidation logic.

D.
AddPrePersist and PreUpdate callback methods with allofthe validation logic.



Leave a Reply 0

Your email address will not be published. Required fields are marked *