- All Implemented Interfaces:
Serializable,Binding<T,U>
- Author:
- Lukas Eder
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionDefaultBinding(Binding<T, U> delegate) DefaultBinding(Converter<T, U> converter) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier 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
-
DefaultBinding
Deprecated, for removal: This API element is subject to removal in a future version.- 3.11 - [#6631] - Usebinding(Converter)instead. -
DefaultBinding
-
-
Method Details
-
binding
Get the internal default binding for aConverter. -
binding
Get the internal default binding for aDataType. -
converter
Description copied from interface:BindingA converter that can convert between the database type and the custom type.While the
Converterproperty of a binding is not optional (Converter.fromType()andConverter.toType()are needed by jOOQ's internals), the conversion implementation (i.e.Converter.from(Object)andConverter.to(Object)) isn't strictly required if implementations don't rely on it. -
sql
Description 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 bothDATEandTIMESTAMPSQL types toTimestamp.
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 interfaceBinding<T,U> - Parameters:
ctx- The context object containing all argument objects.- Throws:
SQLException- Implementations are allowed to pass on allSQLExceptions to the caller to be wrapped inDataAccessExceptions.
-
register
Description copied from interface:BindingRegister aCallableStatement'sOUTparameter.- Specified by:
registerin interfaceBinding<T,U> - Parameters:
ctx- The context object containing all argument objects.- Throws:
SQLException- Implementations are allowed to pass on allSQLExceptions to the caller to be wrapped inDataAccessExceptions.
-
set
Description copied from interface:BindingSet aPreparedStatement'sINparameter.- Specified by:
setin interfaceBinding<T,U> - Parameters:
ctx- The context object containing all argument objects.- Throws:
SQLException- Implementations are allowed to pass on allSQLExceptions to the caller to be wrapped inDataAccessExceptions.
-
set
Description copied from interface:BindingSet aSQLOutput'sINparameter.- Specified by:
setin interfaceBinding<T,U> - Parameters:
ctx- The context object containing all argument objects.- Throws:
SQLException- Implementations are allowed to pass on allSQLExceptions to the caller to be wrapped inDataAccessExceptions.
-
get
Description 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 interfaceBinding<T,U> - Parameters:
ctx- The context object containing all argument objects.- Throws:
SQLException- Implementations are allowed to pass on allSQLExceptions to the caller to be wrapped inDataAccessExceptions.
-
get
Description 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 interfaceBinding<T,U> - Parameters:
ctx- The context object containing all argument objects.- Throws:
SQLException- Implementations are allowed to pass on allSQLExceptions to the caller to be wrapped inDataAccessExceptions.
-
get
Description 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 interfaceBinding<T,U> - Parameters:
ctx- The context object containing all argument objects.- Throws:
SQLException- Implementations are allowed to pass on allSQLExceptions to the caller to be wrapped inDataAccessExceptions.
-
toString
-
binding(Converter)instead.