Interface PopulateValueRequestValidator
- All Superinterfaces:
org.springframework.core.Ordered
- All Known Implementing Classes:
BasicFieldTypeValidator,RuleFieldValidator
public interface PopulateValueRequestValidator
extends org.springframework.core.Ordered
This is injected into the BasicPersistenceModule and invoked prior to any attempts to actually populate values
from the Entity DTO representation into the Hibernate entity using the FieldPersistenceProvider paradigm.
An example validator would ensure that Booleans are actually booleans, integers are actually integers, etc. since all values come in as Strings by default
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionvalidate(PopulateValueRequest populateValueRequest, Serializable instance) Validates a population request prior to invoking anyFieldPersistenceProviders.Methods inherited from interface org.springframework.core.Ordered
getOrder
-
Method Details
-
validate
Validates a population request prior to invoking anyFieldPersistenceProviders. If no validation could be performed for the givenPopulateValueRequestthen return true to let it pass on to a differentPopulateValueRequestValidatoror on to aFieldPersistenceProvider.- Parameters:
populateValueRequest- thePopulateValueRequestthat should be validatedinstance- the Hibernate entity that will attempt to be populated- Returns:
- false if the
PopulateValueRequestfailed validation. In this case, the request should not be passed to anyFieldPersistenceProviders.
-