Specification has annotation @Join(path = "googleSearchResults", alias = "gsr"), and @Spec(params = "googleSearchResultSourceQuality", path = "gsr.sourceQuality", spec = Equal.class)}) when I build my query manually that contains already this join
select
distinct g1_0.id c0,
g2_0.name c1,
g1_0.QUERY c2,
count(g3_0.ID) c3
from
GOOGLE_SEARCH g1_0
join
GOOGLE_LOCATION g2_0
on g2_0.id=g1_0.GOOGLE_LOCATION_ID
left join
GOOGLE_SEARCH_RESULT g3_0
on g1_0.id=g3_0.GOOGLE_SEARCH_ID
left join
GOOGLE_SEARCH_RESULT g4_0
on g1_0.id=g4_0.GOOGLE_SEARCH_ID
where
g1_0.SEARCH_REQUEST_ID=?
and g4_0.SOURCE_QUALITY=?
and 1=1
group by
c0,
c1,
c2 offset ? rows fetch first ? rows only
Specification has annotation
@Join(path = "googleSearchResults", alias = "gsr")
, and@Spec(params = "googleSearchResultSourceQuality", path = "gsr.sourceQuality", spec = Equal.class)})
when I build my query manually that contains already this joinJoin<GoogleSearch, GoogleSearchResult> googleSearchResults = googleSearch.join("googleSearchResults", JoinType.LEFT);
and calling
Predicate wherePredicate = specification.toPredicate(googleSearch, criteriaQuery, criteriaBuilder);
provider creates a duplicate join