Class BeanValidationHandler

java.lang.Object
org.datanucleus.BeanValidationHandler

public class BeanValidationHandler extends Object
Handles the integration of "javax.validation" Bean Validation API (JSR 303). Note that this is the only class referring to BeanValidation classes so that it is usable in environments without BeanValidation present.
  • Field Details

  • Constructor Details

    • BeanValidationHandler

      public BeanValidationHandler(ExecutionContext ec, Object validatorFactory)
      Constructor for a validation handler.
      Parameters:
      ec - ExecutionContext that we are persisting in
      validatorFactory - Validation factory
  • Method Details

    • close

      public void close()
    • validate

      public void validate(Object pc, String callbackName, Class<?>[] groups)
      Validate the constraints of an object
      Parameters:
      pc - the object
      callbackName - Name of the callback
      groups - the validation groups
    • preDelete

      public void preDelete(Object pc)
    • preStore

      public void preStore(Object pc)
    • prePersist

      public void prePersist(Object pc)
    • getGroups

      private Class<?>[] getGroups(String property, String eventName)
      Parse comma separated string of class names and return a corresponding array of classes
      Parameters:
      property - the string with comma separated class names
      Returns:
      The groups