@Test public void testSelectFromInnerJoinOnWhereGroupBy() { int tests = 100; int columns = 5; for (int i = 0; i < tests; i++) { Columns c = new Columns(columns); String tableName = "table" + i; String whereClause = "col1=val1 AND col2=val2"; String groupBy = "col" + i; String tableToJoin = "TableName" + i; String onClause = "table" + i + ".col" + i + "=table" + (i + 1) + ".col" + (i + 1); String sql = new SELECT(c.columns).FROM(tableName) .INNER_JOIN(tableToJoin) .ON(onClause) .WHERE(whereClause) .GROUP_BY(groupBy) .asCompileableStatement().sql; String genSql = c.sql + " FROM " + tableName + " INNER JOIN " + tableToJoin + " ON " + onClause + " WHERE " + whereClause + " GROUP BY " + groupBy; assertEquals(sql, genSql); } }
public FROM FROM(@NonNull String tableName) { return new FROM(this, tableName); }
SELECT extends SqlRootNode { public FROM FROM(@NonNull String tableName) { return new FROM(this, tableName); } }
SELECT extends SqlRootNode { public FROM FROM(@NonNull String tableName) { return new FROM(this, tableName); } SELECT(@NonNull String... columns); }
SELECT extends SqlRootNode { public FROM FROM(@NonNull String tableName) { return new FROM(this, tableName); } SELECT(@NonNull String... columns); @Override String getSql(); FROM FROM(@NonNull String tableName); FROM FROM(@NonNull String... tableNames); }
SELECT extends SqlRootNode { public FROM FROM(@NonNull String tableName) { return new FROM(this, tableName); } SELECT(@NonNull String... columns); @Override String getSql(); FROM FROM(@NonNull String tableName); FROM FROM(@NonNull String... tableNames);  }