Annotation Interface ReferenceExists


@Target(FIELD) @Retention(RUNTIME) @Constraint(validatedBy=ReferenceExistsValidator.class) public @interface ReferenceExists
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Points to a property key in ValidationMessages.properties, which is used to resolve a message in case of violation.
    Specifies the service bean which will be used to verify that object with given ID is exists.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    Allows to define under which circumstances this validation is to be triggered.
    Class<? extends javax.validation.Payload>[]
    Allows to define a payload to be passed with this validation.
  • Element Details

    • service

      Class<? extends IdentifiedService> service
      Specifies the service bean which will be used to verify that object with given ID is exists.
    • message

      String message
      Points to a property key in ValidationMessages.properties, which is used to resolve a message in case of violation.
    • groups

      Class<?>[] groups
      Allows to define under which circumstances this validation is to be triggered.
      Default:
      {}
    • payload

      Class<? extends javax.validation.Payload>[] payload
      Allows to define a payload to be passed with this validation.
      Default:
      {}