Package dev.morphia.query.validation
Class EntityTypeAndIdValueValidator
- java.lang.Object
-
- dev.morphia.query.validation.EntityTypeAndIdValueValidator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapply(MappedClass mappedClass, MappedField mappedField, java.lang.Object value, java.util.List<ValidationFailure> validationFailures)Checks the class of thevalueagainst the type of the ID for thetype.static EntityTypeAndIdValueValidatorgetInstance()Get the instance.
-
-
-
Method Detail
-
getInstance
public static EntityTypeAndIdValueValidator getInstance()
Get the instance.- Returns:
- the Singleton instance of this validator
-
apply
public boolean apply(MappedClass mappedClass, MappedField mappedField, java.lang.Object value, java.util.List<ValidationFailure> validationFailures)
Checks the class of thevalueagainst the type of the ID for thetype. 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 MappedClassmappedField- the MappedFieldvalue- the value for the queryvalidationFailures- the list to add any failures to. If validation passes orappliesToreturned false, this list will not change. @return true if the validation was applied.
-
-