Hello,
I have query with projection and i need to use subquery to count team matches.
query.from(qMatch).where(builder)
.groupBy(queryStringPath).list(
Projections.constructor(TeamResultDto.class,
new JPASubQuery().from(qTeam).where(qTeam.name.eq(qMatch.homeTeam.name)).count(),
queryStringPath, qMatch.homeTeam.name.count())
);
I get :
java.lang.IllegalArgumentException: Undeclared path 'match'. Add this path as a source to the query to be able to reference it.
When i reference match in where or from part of query, everything is ok. But with projections it doesn't work. (builder is not importat for this question so i didn't put it here).
Is this bug or i must reference it on some other way?