From from = new From();
from.addGroup(g);
Function f = new Function("replace", new Expression[] {new ElementSymbol("a", false), new Constant("x"), new Constant("y")}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ExpressionSymbol es = new ExpressionSymbol("y", f); //$NON-NLS-1$
AliasSymbol as = new AliasSymbol("y", es); //$NON-NLS-1$
Select select = new Select();
select.addSymbol(as);
Query query = new Query();
query.setSelect(select);