@Test public void testSelectFromWhereGroupByHavingLimit() { 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 having = "sum(col" + i + ") > " + (i * 100); String limit = "" + i + ", " + (10 + i); String sql = new SELECT(c.columns).FROM(tableName) .WHERE(whereClause) .GROUP_BY(groupBy) .HAVING(having) .LIMIT(limit) .asCompileableStatement().sql; String genSql = c.sql + " FROM " + tableName + " WHERE " + whereClause + " GROUP BY " + groupBy + " HAVING " + having + " LIMIT " + limit; 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);  }