Class ConstraintTransformer<T>
java.lang.Object
com.flowingcode.backendcore.model.ConstraintTransformer<T>
- Type Parameters:
T- The type of the implementation-specific representation of the constraint.
- All Implemented Interfaces:
Function<Constraint,T>
Transform a
Constraint into an implementation-specific representation (such as a JPA Expression).
Subclasses are expected to override the transform(Constraint) method in order to support additional constraint types,
and one or more of the transform*Constraint methods for providing the actual representations for the underlying database technology.- Author:
- Javier Godoy / Flowing Code
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Tapply(Constraint c) Return an implementation-specific representation of the constraint.protected TReturn an implementation-specific representation of the constraint, ornullif it cannot be transformed.protected TReturn an implementation-specific representation of anAttributeBetweenConstraintconstraint.protected TReturn an implementation-specific representation of anAttributeILikeConstraintconstraint.protected TReturn an implementation-specific representation of anAttributeInConstraintconstraint.protected TReturn an implementation-specific representation of anAttributeLikeConstraintconstraint.protected TReturn an implementation-specific representation of aNegatedConstraintconstraint.protected TReturn an implementation-specific representation of aAttributeNullConstraintconstraint.protected TReturn an implementation-specific representation of anAttributeRelationalConstraintconstraint.
-
Constructor Details
-
ConstraintTransformer
public ConstraintTransformer()
-
-
Method Details
-
apply
Return an implementation-specific representation of the constraint.- Specified by:
applyin interfaceFunction<Constraint,T> - Throws:
ConstraintTransformerException- if theConstraintis not supported by this implementation.
-
transform
Return an implementation-specific representation of the constraint, ornullif it cannot be transformed. This method delegated into one of the of thetransform*Constraintmethods, depending on the actual constraint class. -
transformRelationalConstraint
Return an implementation-specific representation of anAttributeRelationalConstraintconstraint.- Returns:
- an implementation-specific representation of the constraint, or
nullif it cannot be transformed.
-
transformLikeConstraint
Return an implementation-specific representation of anAttributeLikeConstraintconstraint.- Returns:
- an implementation-specific representation of the constraint, or
nullif it cannot be transformed.
-
transformBetweenConstraint
Return an implementation-specific representation of anAttributeBetweenConstraintconstraint.- Returns:
- an implementation-specific representation of the constraint, or
nullif it cannot be transformed.
-
transformInConstraint
Return an implementation-specific representation of anAttributeInConstraintconstraint.- Returns:
- an implementation-specific representation of the constraint, or
nullif it cannot be transformed.
-
transformNegatedConstraint
Return an implementation-specific representation of aNegatedConstraintconstraint.- Returns:
- an implementation-specific representation of the constraint, or
nullif it cannot be transformed.
-
transformNullConstraint
Return an implementation-specific representation of aAttributeNullConstraintconstraint.- Returns:
- an implementation-specific representation of the constraint, or
nullif it cannot be transformed.
-
transformILikeConstraint
Return an implementation-specific representation of anAttributeILikeConstraintconstraint.- Returns:
- an implementation-specific representation of the constraint, or
nullif it cannot be transformed.
-