How to add column from join table to select statement?
For example I have this predicate:
public Predicate toPredicate(Root<Coection> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
query.distinct(true);
SetJoin<Coection, CoectionResearch> rootResearches = root.join(Coection_.researches);
query.orderBy(cb.asc(rootResearches.get(CoectionResearch_.pullForce)));
retu cb.le(rootResearches.get(CoectionResearch_.pullForce), this.pullforce);
}
SQL:
select distinct coection0_.coection_id as coecti1_24_, ...
from sm_coection coection0_
ier join sm_coection_research researches1_ on coection0_.coection_id=researches1_.coection_id
where researches1_.pull_force<=15 order by researches1_.pull_force asc
How to add to this select "researches1_.pull_force" for final SQL:
select distinct coection0_.coection_id as coecti1_24_, ..., researches1_.pull_force
