- All Implemented Interfaces:
- Serializable,- Binding<T,- U> 
- Author:
- Lukas Eder
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultBinding(Binding<T, U> delegate) DefaultBinding(Converter<T, U> converter) Deprecated, for removal: This API element is subject to removal in a future version.
- 
Method SummaryModifier and TypeMethodDescriptionstatic final <T,U> Binding<T, U> Get the internal default binding for aConverter.static final <T> Binding<T,T> Get the internal default binding for aDataType.A converter that can convert between the database type and the custom type.voidget(BindingGetResultSetContext<U> ctx) Get aResultSet'sOUTvalue.voidget(BindingGetSQLInputContext<U> ctx) Get aSQLInput'sOUTvalue.voidget(BindingGetStatementContext<U> ctx) Get aCallableStatement'sOUTvalue.voidregister(BindingRegisterContext<U> ctx) Register aCallableStatement'sOUTparameter.voidset(BindingSetSQLOutputContext<U> ctx) Set aSQLOutput'sINparameter.voidset(BindingSetStatementContext<U> ctx) Set aPreparedStatement'sINparameter.voidsql(BindingSQLContext<U> ctx) Generate SQL code for the bind variable.toString()
- 
Constructor Details- 
DefaultBindingDeprecated, for removal: This API element is subject to removal in a future version.- 3.11 - [#6631] - Usebinding(Converter)instead.
- 
DefaultBinding
 
- 
- 
Method Details- 
bindingGet the internal default binding for aConverter.
- 
bindingGet the internal default binding for aDataType.
- 
converterDescription copied from interface:BindingA converter that can convert between the database type and the custom type.
- 
sqlDescription copied from interface:BindingGenerate SQL code for the bind variable.Implementations should generate SQL code onto BindingSQLContext.render(), given the context's bind variable located atBindingSQLContext.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.
 
 - Context.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- DATEand- TIMESTAMPSQL types to- Timestamp.
 
 - Context.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)andBinding.set(BindingSetStatementContext), i.e. when bind variables are inlined, then they must not be bound to thePreparedStatementinBinding.set(BindingSetStatementContext)- Specified by:
- sqlin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
registerDescription copied from interface:BindingRegister aCallableStatement'sOUTparameter.- Specified by:
- registerin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
setDescription copied from interface:BindingSet aPreparedStatement'sINparameter.- Specified by:
- setin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
setDescription copied from interface:BindingSet aSQLOutput'sINparameter.- Specified by:
- setin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
getDescription copied from interface:BindingGet aResultSet'sOUTvalue.Implementations are expected to produce a value by calling BindingGetResultSetContext.value(Object), passing the resulting value to the method.- Specified by:
- getin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
getDescription copied from interface:BindingGet aCallableStatement'sOUTvalue.Implementations are expected to produce a value by calling BindingGetStatementContext.value(Object), passing the resulting value to the method.- Specified by:
- getin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
getDescription copied from interface:BindingGet aSQLInput'sOUTvalue.Implementations are expected to produce a value by calling BindingGetSQLInputContext.value(Object), passing the resulting value to the method.- Specified by:
- getin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
toString
 
- 
binding(Converter)instead.