public class DefaultBinding<T,U> extends Object implements Binding<T,U>
| Constructor and Description | 
|---|
| DefaultBinding(Converter<T,U> converter)Deprecated. 
 - 3.11 - [#6631] - Use  binding(Converter)instead. | 
| Modifier and Type | Method and Description | 
|---|---|
| static <T,U> Binding<T,U> | binding(Converter<T,U> converter) | 
| Converter<T,U> | converter()A converter that can convert between the database type and the custom
 type. | 
| void | get(BindingGetResultSetContext<U> ctx)Get a  ResultSet'sOUTvalue. | 
| void | get(BindingGetSQLInputContext<U> ctx)Get a  SQLInput'sOUTvalue. | 
| void | get(BindingGetStatementContext<U> ctx)Get a  CallableStatement'sOUTvalue. | 
| void | register(BindingRegisterContext<U> ctx)Register a  CallableStatement'sOUTparameter. | 
| void | set(BindingSetSQLOutputContext<U> ctx)Set a  SQLOutput'sINparameter. | 
| void | set(BindingSetStatementContext<U> ctx)Set a  PreparedStatement'sINparameter. | 
| void | sql(BindingSQLContext<U> ctx)Generate SQL code for the bind variable. | 
| String | toString() | 
@Deprecated public DefaultBinding(Converter<T,U> converter)
binding(Converter) instead.public Converter<T,U> converter()
Bindingpublic void sql(BindingSQLContext<U> ctx) throws SQLException
Binding
 Implementations should generate SQL code onto
 BindingSQLContext.render(), given the context's bind variable
 located at BindingSQLContext.value(). Examples of such SQL code
 are:
 
"?": Default implementations can simply generate a
 question mark."123": Implementations may choose to inline bind
 variables to influence execution plan generation.RenderContext.paramType() contains information whether inlined
 bind variables are expected in the current context."CAST(? AS DATE)": Cast a database to a more specific
 type. This can be useful in databases like Oracle, which map both
 DATE and TIMESTAMP SQL types to
 Timestamp.RenderContext.castMode() may contain some hints about whether
 casting is suggested in the current context."?::json": Vendor-specific bind variables can be
 supported, e.g. SQLDialect.POSTGRES's JSON data type.
 Implementations must provide consistent behaviour between
 Binding.sql(BindingSQLContext) and
 Binding.set(BindingSetStatementContext), i.e. when bind variables are
 inlined, then they must not be bound to the PreparedStatement in
 Binding.set(BindingSetStatementContext)
sql in interface Binding<T,U>ctx - The context object containing all argument objects.SQLException - Implementations are allowed to pass on all
             SQLExceptions to the caller to be wrapped in
             DataAccessExceptions.public void register(BindingRegisterContext<U> ctx) throws SQLException
BindingCallableStatement's OUT parameter.register in interface Binding<T,U>ctx - The context object containing all argument objects.SQLException - Implementations are allowed to pass on all
             SQLExceptions to the caller to be wrapped in
             DataAccessExceptions.public void set(BindingSetStatementContext<U> ctx) throws SQLException
BindingPreparedStatement's IN parameter.set in interface Binding<T,U>ctx - The context object containing all argument objects.SQLException - Implementations are allowed to pass on all
             SQLExceptions to the caller to be wrapped in
             DataAccessExceptions.public void set(BindingSetSQLOutputContext<U> ctx) throws SQLException
BindingSQLOutput's IN parameter.set in interface Binding<T,U>ctx - The context object containing all argument objects.SQLException - Implementations are allowed to pass on all
             SQLExceptions to the caller to be wrapped in
             DataAccessExceptions.public void get(BindingGetResultSetContext<U> ctx) throws SQLException
BindingResultSet's OUT value.
 
 Implementations are expected to produce a value by calling
 BindingGetResultSetContext.value(Object), passing the resulting
 value to the method.
get in interface Binding<T,U>ctx - The context object containing all argument objects.SQLException - Implementations are allowed to pass on all
             SQLExceptions to the caller to be wrapped in
             DataAccessExceptions.public void get(BindingGetStatementContext<U> ctx) throws SQLException
BindingCallableStatement's OUT value.
 
 Implementations are expected to produce a value by calling
 BindingGetStatementContext.value(Object), passing the resulting
 value to the method.
get in interface Binding<T,U>ctx - The context object containing all argument objects.SQLException - Implementations are allowed to pass on all
             SQLExceptions to the caller to be wrapped in
             DataAccessExceptions.public void get(BindingGetSQLInputContext<U> ctx) throws SQLException
BindingSQLInput's OUT value.
 
 Implementations are expected to produce a value by calling
 BindingGetSQLInputContext.value(Object), passing the resulting
 value to the method.
get in interface Binding<T,U>ctx - The context object containing all argument objects.SQLException - Implementations are allowed to pass on all
             SQLExceptions to the caller to be wrapped in
             DataAccessExceptions.Copyright © 2019. All rights reserved.