如何按提取列排序?

我的谓词:

CriteriaQuery<Connection> cquery = (CriteriaQuery<Connection>) query;
Fetch<Connection, ConnectionResearch> researches = root.fetch(Connection_.researches, JoinType.INNER);
cquery.orderBy(cb.asc( /* researches.get(ConnectionResearch_.pullforce) */ ));


如何通过ConnectionResearch.pullforce获取列设置选择查询顺序?

最佳答案

解:

Join<Connection, ConnectionResearch> researches = (Join<Connection, ConnectionResearch>) root.fetch(Connection_.researches);
cquery.orderBy(cb.asc(researches.get(ConnectionResearch_.pullForce)));

关于java - 如何按提取列排序?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38685933/

10-10 05:55