Class EntityTypeAndIdValueValidator

  • All Implemented Interfaces:
    Validator

    public final class EntityTypeAndIdValueValidator
    extends java.lang.Object
    implements Validator
    Checks the class of the value against the type of the ID for the type.
    • Method Detail

      • apply

        public boolean apply​(MappedClass mappedClass,
                             MappedField mappedField,
                             java.lang.Object value,
                             java.util.List<ValidationFailure> validationFailures)
        Checks the class of the value against the type of the ID for the type. Always applies this validation, but there's room to change this to not apply it if, for example, the type is not an entity.
        Parameters:
        mappedClass - the MappedClass
        mappedField - the MappedField
        value - the value for the query
        validationFailures - the list to add any failures to. If validation passes or appliesTo returned false, this list will not change. @return true if the validation was applied.