use of com.blazebit.persistence.parser.expression.modifier.ExpressionModifier in project blaze-persistence by Blazebit.
the class AbstractCommonQueryBuilder method inlineSelectAlias.
void inlineSelectAlias(String selectAlias, Expression expression) {
final AliasReplacementVisitor aliasReplacementVisitor = new AliasReplacementVisitor(expression, selectAlias);
ExpressionModifierVisitor<ExpressionModifier> expressionModifierVisitor = new ExpressionModifierVisitor<ExpressionModifier>() {
@Override
public void visit(ExpressionModifier expressionModifier, ClauseType clauseType) {
Expression expr = expressionModifier.get();
Expression newExpr = expr.accept(aliasReplacementVisitor);
if (expr != newExpr) {
expressionModifier.set(newExpr);
}
}
};
joinManager.apply(expressionModifierVisitor);
selectManager.apply(expressionModifierVisitor);
whereManager.apply(expressionModifierVisitor);
havingManager.apply(expressionModifierVisitor);
groupByManager.apply(expressionModifierVisitor);
orderByManager.apply(expressionModifierVisitor);
}
Aggregations