You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I want use ":aOptionnalParam IS NOT NULL" in correlationExpression, I have this compil error :
An error occurred while trying to resolve the condition expression 'providersAffectToLeg.rowid = correlationKey.rowid AND (:transportationModeFilter IS NOT NULL OR transportationMode.rowid = :transportationModeFilter)' of the attribute legSolutions[fr.******.api.dao.projection.ProviderAffectToLegSummaryProjection.getLegSolutions]: Illegal occurence of [:transportationModeFilter] in path chain resolver! Parameters are not allowed as results in mapping. Please use @MappingParameter for this instead!
Steps to reproduce
This correlationExpression not working :
@EntityView(ProvidersAffectToLeg.class)
public interface ProviderAffectToLegSummaryProjection {
@IdMapping
Long getRowid();
ProviderSummaryProjection getProvider();
@MappingCorrelatedSimple(
correlationBasis = "rowid",
correlated = LegSolution.class,
correlationExpression = "providersAffectToLeg.rowid IN correlationKey " +
"AND (:transportationModeFilter IS NULL OR transportationMode.rowid=:transportationModeFilter)",
fetch = FetchStrategy.JOIN
)
List<LegSolutionSummaryProjection> getLegSolutions();
}
That's why I wanted to overwrite the default mapping of my collection
The solution I've found is to let the default mapping on my view, and process the result of my query during my view->dto mapping to remove unwanted kittens. That works too, but I'm fetching kittens for nothing.
If you want to filter the collection, why not just add a @AttributeFilter(ContainsFilter.class) on KittenView#getName() and activate that via addAttributeFilter("kittens.name", "e")?
Description
When I want use ":aOptionnalParam IS NOT NULL" in correlationExpression, I have this compil error :
An error occurred while trying to resolve the condition expression 'providersAffectToLeg.rowid = correlationKey.rowid AND (:transportationModeFilter IS NOT NULL OR transportationMode.rowid = :transportationModeFilter)' of the attribute legSolutions[fr.******.api.dao.projection.ProviderAffectToLegSummaryProjection.getLegSolutions]: Illegal occurence of [:transportationModeFilter] in path chain resolver! Parameters are not allowed as results in mapping. Please use @MappingParameter for this instead!
Steps to reproduce
This correlationExpression not working :
This correlationExpression working :
It's a bug ?
The text was updated successfully, but these errors were encountered: