@Test public void buildSql() throws Exception { List<String> columns = Lists.newArrayList("id2", "user_name", "user_age"); CustomQueryBuilder b = new CustomQueryBuilder(columns, "where id = :1"); assertThat(b.buildSql(), equalTo("select id2, user_name, user_age from #table where id = :1")); }
@Override public String buildSql() { String s1 = Joiner.on(", ").join(columns); return String.format(SQL_TEMPLATE, s1, tailOfSql); }
CustomQueryBuilder extends AbstractCustomBuilder { @Override public String buildSql() { String s1 = Joiner.on(", ").join(columns); return String.format(SQL_TEMPLATE, s1, tailOfSql); } }
CustomQueryBuilder extends AbstractCustomBuilder { @Override public String buildSql() { String s1 = Joiner.on(", ").join(columns); return String.format(SQL_TEMPLATE, s1, tailOfSql); } CustomQueryBuilder(List<String> columns, String tailOfSql); }
CustomQueryBuilder extends AbstractCustomBuilder { @Override public String buildSql() { String s1 = Joiner.on(", ").join(columns); return String.format(SQL_TEMPLATE, s1, tailOfSql); } CustomQueryBuilder(List<String> columns, String tailOfSql); @Override String buildSql(); }
CustomQueryBuilder extends AbstractCustomBuilder { @Override public String buildSql() { String s1 = Joiner.on(", ").join(columns); return String.format(SQL_TEMPLATE, s1, tailOfSql); } CustomQueryBuilder(List<String> columns, String tailOfSql); @Override String buildSql();  }