Skip to content

Instantly share code, notes, and snippets.

@vietj
Created March 23, 2020 16:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vietj/8770ff31a2850fc01aec5d4545e7a6ac to your computer and use it in GitHub Desktop.
@VertxGen
public interface SqlTemplate<R> {
static SqlTemplate<RowSet<Row>> forQuery(SqlClient client, String template) {
Collector<Row, ?, SqlResult<Row>> collector = null;
Function<SqlResult<Row>, RowSet<Row>> bilto = null;
return new SqlTemplateImpl<SqlResult<Row>, RowSet<Row>>(client, collector, bilto, template);
}
static SqlTemplate<SqlResult<Void>> forUpdate(SqlClient client, String template) {
return null;
}
@GenIgnore
<U> SqlTemplate<SqlResult<U>> collecting(Collector<Row, ?, U> collector);
<U> SqlTemplate<RowSet<U>> mapping(Class<U> type);
<U> SqlTemplate<RowSet<U>> mapping(Function<Row, U> mapper);
// Single
void execute(Tuple tuple, Handler<AsyncResult<R>> handler);
// Batch
void execute(List<Tuple> tuple, Handler<AsyncResult<R>> handler);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment