Class SqlTemplate<I,R>
- java.lang.Object
- 
- io.vertx.mutiny.sqlclient.templates.SqlTemplate<I,R>
 
- 
 public class SqlTemplate<I,R> extends Object An SQL template.SQL templates are useful for interacting with a relational database. SQL templates execute queries using named instead of positional parameters. Query execution is parameterized by a map of string to objects instead of a Tuple. The default source of parameters is a simple map, a user defined mapping can be used instead given it maps the source to such a map.SQL template default results are , a user defined mapping can be used instead, mapping the result set to a of the mapped type. NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
- 
- 
Field SummaryFields Modifier and Type Field Description static TypeArg<SqlTemplate>__TYPE_ARGTypeArg<I>__typeArg_0TypeArg<R>__typeArg_1
 - 
Constructor SummaryConstructors Constructor Description SqlTemplate(io.vertx.sqlclient.templates.SqlTemplate delegate)SqlTemplate(io.vertx.sqlclient.templates.SqlTemplate delegate, TypeArg<I> typeArg_0, TypeArg<R> typeArg_1)SqlTemplate(Object delegate, TypeArg<I> typeArg_0, TypeArg<R> typeArg_1)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)io.smallrye.mutiny.Uni<R>execute(I parameters)Execute the query with theparametersRexecuteAndAwait(I parameters)Blocking variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#execute(I).voidexecuteAndForget(I parameters)Variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#execute(I)that ignores the result of the operation.io.smallrye.mutiny.Uni<R>executeBatch(List<I> batch)Execute a batch query with thebatch.RexecuteBatchAndAwait(List<I> batch)Blocking variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#executeBatch(List).voidexecuteBatchAndForget(List<I> batch)Variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#executeBatch(List)that ignores the result of the operation.static SqlTemplate<Map<String,Object>,RowSet<Row>>forQuery(SqlClient client, String template)static SqlTemplate<Map<String,Object>,SqlResult<Void>>forUpdate(SqlClient client, String template)io.vertx.sqlclient.templates.SqlTemplategetDelegate()inthashCode()<T> SqlTemplate<T,R>mapFrom(TupleMapper<T> mapper)<T> SqlTemplate<T,R>mapFrom(Class<T> type)<U> SqlTemplate<I,RowSet<U>>mapTo(RowMapper<U> mapper)<U> SqlTemplate<I,RowSet<U>>mapTo(Class<U> type)static <I,R>
 SqlTemplate<I,R>newInstance(io.vertx.sqlclient.templates.SqlTemplate arg)static <I,R>
 SqlTemplate<I,R>newInstance(io.vertx.sqlclient.templates.SqlTemplate arg, TypeArg<I> __typeArg_I, TypeArg<R> __typeArg_R)StringtoString()
 
- 
- 
- 
Method Detail- 
getDelegatepublic io.vertx.sqlclient.templates.SqlTemplate getDelegate() 
 - 
forQuerypublic static SqlTemplate<Map<String,Object>,RowSet<Row>> forQuery(SqlClient client, String template) - Parameters:
- client- the wrapped SQL client
- template- the template query string
- Returns:
- the template
 
 - 
forUpdatepublic static SqlTemplate<Map<String,Object>,SqlResult<Void>> forUpdate(SqlClient client, String template) - Parameters:
- client- the wrapped SQL client
- template- the template update string
- Returns:
- the template
 
 - 
mapFrompublic <T> SqlTemplate<T,R> mapFrom(TupleMapper<T> mapper) - Parameters:
- mapper- the mapping function
- Returns:
- a new template
 
 - 
mapFrompublic <T> SqlTemplate<T,R> mapFrom(Class<T> type) - Parameters:
- type- the mapping type
- Returns:
- a new template
 
 - 
mapTopublic <U> SqlTemplate<I,RowSet<U>> mapTo(RowMapper<U> mapper) - Parameters:
- mapper- the mapping function
- Returns:
- a new template
 
 - 
mapTopublic <U> SqlTemplate<I,RowSet<U>> mapTo(Class<U> type) - Parameters:
- type- the mapping type
- Returns:
- a new template
 
 - 
execute@CheckReturnValue public io.smallrye.mutiny.Uni<R> execute(I parameters) Execute the query with theparametersUnlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- parameters- the query parameters
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
executeAndAwaitpublic R executeAndAwait(I parameters) Blocking variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#execute(I).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- parameters- the query parameters
- Returns:
- the R instance produced by the operation.
 
 - 
executeAndForgetpublic void executeAndForget(I parameters) Variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#execute(I)that ignores the result of the operation.This method subscribes on the result of io.vertx.mutiny.sqlclient.templates.SqlTemplate#execute(I), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.sqlclient.templates.SqlTemplate#execute(I)but you don't need to compose it with other operations.- Parameters:
- parameters- the query parameters
 
 - 
executeBatch@CheckReturnValue public io.smallrye.mutiny.Uni<R> executeBatch(List<I> batch) Execute a batch query with thebatch.Each item in the batch is mapped to a tuple. Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- batch- the batch
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
executeBatchAndAwaitpublic R executeBatchAndAwait(List<I> batch) Blocking variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#executeBatch(List).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- batch- the batch
- Returns:
- the R instance produced by the operation.
 
 - 
executeBatchAndForgetpublic void executeBatchAndForget(List<I> batch) Variant ofio.vertx.mutiny.sqlclient.templates.SqlTemplate#executeBatch(List)that ignores the result of the operation.This method subscribes on the result of io.vertx.mutiny.sqlclient.templates.SqlTemplate#executeBatch(List), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.sqlclient.templates.SqlTemplate#executeBatch(List)but you don't need to compose it with other operations.- Parameters:
- batch- the batch
 
 - 
newInstancepublic static <I,R> SqlTemplate<I,R> newInstance(io.vertx.sqlclient.templates.SqlTemplate arg) 
 - 
newInstancepublic static <I,R> SqlTemplate<I,R> newInstance(io.vertx.sqlclient.templates.SqlTemplate arg, TypeArg<I> __typeArg_I, TypeArg<R> __typeArg_R) 
 
- 
 
-