172173174175176177178179180181182
for ( SortCondition sc : conditions ) { Expr e = sc.getExpression() ; Expr e2 = ExprTransformer.transform(exprTransform, e) ; conditions2.add(new SortCondition(e2, sc.getDirection())) ; if ( e != e2 ) changed = true ; } OpOrder x = opOrder ; if ( changed )
443444445446447448449450451452
} @Override public void visit(OpOrder opOrder) { for (Iterator<SortCondition> iter = opOrder.getConditions().iterator(); iter.hasNext();) { SortCondition sc = iter.next() ; Set<Var> x = sc.getExpression().getVarsMentioned() ; acc.addAll(x) ; } }
620621622623624625626627628
direction = Query.ORDER_DESCENDING ; item = item.getList().get(1) ; } Expr expr = BuilderExpr.buildExpr(item) ; if ( expr.isVariable() ) return new SortCondition(expr.getExprVar().asVar(), direction) ; else return new SortCondition(expr, direction) ; }
649650651652653654655656657658659
// Aggregates in ORDER BY for ( SortCondition sc : query.getOrderBy() ) { Expr e = sc.getExpression() ; e = ExprLib.replaceAggregateByVariable(e) ; scList.add(new SortCondition(e, sc.getDirection())) ; } op = new OpOrder(op, scList) ; }