@Test public void testFormSelectWithTableName() { a(dialect.formSelect("people", null, null, new ArrayList<String>(), -1, -1)).shouldBeEqual("SELECT * FROM people"); a(dialect.formSelect("people", null, "name = ?", new ArrayList<String>(), -1, -1)).shouldBeEqual("SELECT * FROM people WHERE name = ?"); a(dialect.formSelect("people", null, "name = ?", Arrays.asList("name"), -1, -1)).shouldBeEqual("SELECT * FROM people WHERE name = ? ORDER BY name"); a(dialect.formSelect("people", null, null, Arrays.asList("last_name", "name"), -1, -1)).shouldBeEqual("SELECT * FROM people ORDER BY last_name, name"); }
@Override public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset) { StringBuilder fullQuery = new StringBuilder(); appendSelect(fullQuery, tableName, columns, null, subQuery, orderBys); if(limit != -1){ fullQuery.append(" LIMIT ").append(limit); } if(offset != -1){ fullQuery.append(" OFFSET ").append(offset); } return fullQuery.toString(); }
PostgreSQLDialect extends DefaultDialect { @Override public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset) { StringBuilder fullQuery = new StringBuilder(); appendSelect(fullQuery, tableName, columns, null, subQuery, orderBys); if(limit != -1){ fullQuery.append(" LIMIT ").append(limit); } if(offset != -1){ fullQuery.append(" OFFSET ").append(offset); } return fullQuery.toString(); } }
PostgreSQLDialect extends DefaultDialect { @Override public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset) { StringBuilder fullQuery = new StringBuilder(); appendSelect(fullQuery, tableName, columns, null, subQuery, orderBys); if(limit != -1){ fullQuery.append(" LIMIT ").append(limit); } if(offset != -1){ fullQuery.append(" OFFSET ").append(offset); } return fullQuery.toString(); }  }
PostgreSQLDialect extends DefaultDialect { @Override public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset) { StringBuilder fullQuery = new StringBuilder(); appendSelect(fullQuery, tableName, columns, null, subQuery, orderBys); if(limit != -1){ fullQuery.append(" LIMIT ").append(limit); } if(offset != -1){ fullQuery.append(" OFFSET ").append(offset); } return fullQuery.toString(); }  @Override String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset); }
PostgreSQLDialect extends DefaultDialect { @Override public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset) { StringBuilder fullQuery = new StringBuilder(); appendSelect(fullQuery, tableName, columns, null, subQuery, orderBys); if(limit != -1){ fullQuery.append(" LIMIT ").append(limit); } if(offset != -1){ fullQuery.append(" OFFSET ").append(offset); } return fullQuery.toString(); }  @Override String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset);  }