@Test public void testBuildSelectFromTableAndParsedExpression() throws JSQLParserException { Select select = SelectUtils.buildSelectFromTableAndExpressions(new Table("mytable"), "a+b", "test"); assertEquals("SELECT a + b, test FROM mytable", select.toString()); assertTrue(((SelectExpressionItem)((PlainSelect)select.getSelectBody()).getSelectItems().get(0)).getExpression() instanceof Addition); }
public static Select buildSelectFromTableAndExpressions(Table table, Expression ... expr) { SelectItem[] list = new SelectItem[expr.length]; for (int i=0;i<expr.length;i++) { list[i]=new SelectExpressionItem(expr[i]); } return buildSelectFromTableAndSelectItems(table, list); }
SelectUtils { public static Select buildSelectFromTableAndExpressions(Table table, Expression ... expr) { SelectItem[] list = new SelectItem[expr.length]; for (int i=0;i<expr.length;i++) { list[i]=new SelectExpressionItem(expr[i]); } return buildSelectFromTableAndSelectItems(table, list); } }
SelectUtils { public static Select buildSelectFromTableAndExpressions(Table table, Expression ... expr) { SelectItem[] list = new SelectItem[expr.length]; for (int i=0;i<expr.length;i++) { list[i]=new SelectExpressionItem(expr[i]); } return buildSelectFromTableAndSelectItems(table, list); } private  SelectUtils(); }
SelectUtils { public static Select buildSelectFromTableAndExpressions(Table table, Expression ... expr) { SelectItem[] list = new SelectItem[expr.length]; for (int i=0;i<expr.length;i++) { list[i]=new SelectExpressionItem(expr[i]); } return buildSelectFromTableAndSelectItems(table, list); } private  SelectUtils(); static Select buildSelectFromTableAndExpressions(Table table, Expression ... expr); static Select buildSelectFromTableAndExpressions(Table table, String ... expr); static Select buildSelectFromTableAndSelectItems(Table table, SelectItem ... selectItems); static Select buildSelectFromTable(Table table); static void addExpression(Select select, final Expression expr); static Join addJoin(Select select, final Table table, final Expression onExpression); static void addGroupBy(Select select, final Expression expr); }
SelectUtils { public static Select buildSelectFromTableAndExpressions(Table table, Expression ... expr) { SelectItem[] list = new SelectItem[expr.length]; for (int i=0;i<expr.length;i++) { list[i]=new SelectExpressionItem(expr[i]); } return buildSelectFromTableAndSelectItems(table, list); } private  SelectUtils(); static Select buildSelectFromTableAndExpressions(Table table, Expression ... expr); static Select buildSelectFromTableAndExpressions(Table table, String ... expr); static Select buildSelectFromTableAndSelectItems(Table table, SelectItem ... selectItems); static Select buildSelectFromTable(Table table); static void addExpression(Select select, final Expression expr); static Join addJoin(Select select, final Table table, final Expression onExpression); static void addGroupBy(Select select, final Expression expr);  }