JPA Validation Strategy

NetBeans allows me to choose between three values ​​for the JPA validation strategy: Auto, Callback, and None. What does "Auto" mean? “Callback” means using @PrePersist, @PreUpdate and @PreRemove?

Is performance a hit if I use Auto or Callback if there is no check to execute?

+5
source share
1 answer

The JPA 2.0 specification (JSR 317) does not require the implementation of Bean Validation (JSR-303). Validation is optional. Thus, it javax.persistence.ValidationModecan take different values:

  • Auto ( ) - ,
  • Callback - PersistenceException,
  • None - ,

.

+7

All Articles