2016-07-31 42 views
0

如何通過獲取列進行排序?如何通過獲取列進行排序?

我斷言:

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設置選擇查詢順序讀取列?

+0

你的意思是,要我取消我的代碼? –

回答

1

解決方案:

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