Based on demand to allow composition of specifications across various input types (joins, embeddables) and types of the entity type hierarchy, there's a limitation on how far we can support these cases with Specification. We however have PredicateSpecification that is meant for composition but its current signature requires Root<T>. We've been asked to accept From instead. From defines source and target types that interfere with our type assumption T.
We have the options to either drop the type or pin it to From<?, T>. Introducing another type parameter for the source type seems not ideal.
So we would apply the type T for PredicateSpecification to the From<?, T> target type. While implementations lose the source type information, they benefit from a wider range or accepting joins and embeddable types.
References:
Based on demand to allow composition of specifications across various input types (joins, embeddables) and types of the entity type hierarchy, there's a limitation on how far we can support these cases with
Specification. We however havePredicateSpecificationthat is meant for composition but its current signature requiresRoot<T>. We've been asked to acceptFrominstead.Fromdefines source and target types that interfere with our type assumptionT.We have the options to either drop the type or pin it to
From<?, T>. Introducing another type parameter for the source type seems not ideal.So we would apply the type
TforPredicateSpecificationto theFrom<?, T>target type. While implementations lose the source type information, they benefit from a wider range or accepting joins and embeddable types.References: