خرید بک لینک

Vote count: 0

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

asked 38 secs ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 10 مرداد 1395 ساعت: 9:26

صفحه بندی