Class IntegrityConstraintsValidator
java.lang.Object
cz.cvut.kbss.jopa.sessions.validator.IntegrityConstraintsValidator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Predicate<FieldSpecification<? super T,
?>> Creates a predicate filtering attributes that contain inferred values.static <T> Predicate<FieldSpecification<? super T,
?>> Creates a predicate filtering attributes whose fetch type isFetchType.LAZY
.void
validate
(ObjectChangeSet changeSet, Metamodel metamodel) Validates integrity constraints for changes in the specified change set.abstract void
validate
(Object identifier, FieldSpecification<?, ?> attribute, Object attributeValue) Validates whether the specified value conforms to the attribute integrity constraints.final <T> void
validate
(T instance, EntityType<T> et, Predicate<FieldSpecification<? super T, ?>>... filters) Validates integrity constraints of all attributes of the specified instance.
-
Constructor Details
-
IntegrityConstraintsValidator
public IntegrityConstraintsValidator()
-
-
Method Details
-
getValidator
-
validate
@SafeVarargs public final <T> void validate(T instance, EntityType<T> et, Predicate<FieldSpecification<? super T, ?>>... filters) Validates integrity constraints of all attributes of the specified instance.- Type Parameters:
T
- Entity class type- Parameters:
instance
- The instance to validateet
- EntityType of the instancefilters
- Filters allowing to specify attributes whose validation should be skipped
-
validate
Validates integrity constraints for changes in the specified change set.- Parameters:
changeSet
- The change set to validatemetamodel
- Metamodel of the persistence unit
-
validate
public abstract void validate(Object identifier, FieldSpecification<?, ?> attribute, Object attributeValue) Validates whether the specified value conforms to the attribute integrity constraints.- Parameters:
identifier
- Instance identifierattribute
- Attribute metadata with integrity constraintsattributeValue
- Value to be validated
-
isNotLazy
Creates a predicate filtering attributes whose fetch type isFetchType.LAZY
.- Type Parameters:
T
- Entity type- Returns:
- Predicate
-
isNotInferred
Creates a predicate filtering attributes that contain inferred values.- Type Parameters:
T
- Entity type- Returns:
- Predicate
-