Statement declStmt = new DeclareStatement(var1, shortType);
//ifblock
Expression[] args = new Expression[] {new Constant("x"), new Constant("y")}; //$NON-NLS-1$ //$NON-NLS-2$
Function function = new Function("concat", args); //$NON-NLS-1$
AssignmentStatement queryStmt = new AssignmentStatement(var1, function);
Block ifBlock = new Block();
ifBlock.addStatement(queryStmt);
//else block
ElementSymbol var2 = new ElementSymbol("var2"); //$NON-NLS-1$
Statement elseDeclStmt = new DeclareStatement(var2, shortType);
List elseSymbols = new ArrayList();
elseSymbols.add(new ElementSymbol("b1")); //$NON-NLS-1$
Select elseSelect = new Select(elseSymbols);
From from = new From();
from.addGroup(new GroupSymbol("g")); //$NON-NLS-1$
Criteria criteria = new CompareCriteria(new ElementSymbol("a2"), CompareCriteria.EQ, //$NON-NLS-1$
new Constant(new Integer(5)));
Query elseQuery = new Query();
elseQuery.setSelect(elseSelect);
elseQuery.setFrom(from);
elseQuery.setCriteria(criteria);
AssignmentStatement elseQueryStmt = new AssignmentStatement(var2, elseQuery);
Block elseBlock = new Block();
List elseStmts = new ArrayList();
elseStmts.add(elseDeclStmt);
elseStmts.add(elseQueryStmt);