- All Implemented Interfaces:
Serializable
,Binding<XML,
T>
Object
types to SQLXML
types from your database.
Subtypes may extend this type to provide actual bound type.
- Author:
- Lukas Eder
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionA converter that can convert between the database type and the custom type.final void
get
(BindingGetResultSetContext<T> ctx) Get aResultSet
'sOUT
value.final void
get
(BindingGetSQLInputContext<T> ctx) Get aSQLInput
'sOUT
value.final void
get
(BindingGetStatementContext<T> ctx) Get aCallableStatement
'sOUT
value.final void
register
(BindingRegisterContext<T> ctx) Register aCallableStatement
'sOUT
parameter.final void
set
(BindingSetSQLOutputContext<T> ctx) Set aSQLOutput
'sIN
parameter.final void
set
(BindingSetStatementContext<T> ctx) Set aPreparedStatement
'sIN
parameter.final void
sql
(BindingSQLContext<T> ctx) Generate SQL code for the bind variable.
-
Constructor Details
-
AbstractXMLasObjectBinding
-
-
Method Details
-
converter
Description copied from interface:Binding
A converter that can convert between the database type and the custom type.While the
Converter
property 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. If these conversion implementations are non-functional, it is advised to hint at this fact inConverter.fromSupported()
andConverter.toSupported()
. -
sql
Description copied from interface:Binding
Generate 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 bothDATE
andTIMESTAMP
SQL 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 thePreparedStatement
inBinding.set(BindingSetStatementContext)
- Specified by:
sql
in interfaceBinding<XML,
T> - Parameters:
ctx
- The context object containing all argument objects.- Throws:
SQLException
- Implementations are allowed to pass on allSQLException
s to the caller to be wrapped inDataAccessException
s.
-
register
Description copied from interface:Binding
Register aCallableStatement
'sOUT
parameter.- Specified by:
register
in interfaceBinding<XML,
T> - Parameters:
ctx
- The context object containing all argument objects.- Throws:
SQLException
- Implementations are allowed to pass on allSQLException
s to the caller to be wrapped inDataAccessException
s.
-
set
Description copied from interface:Binding
Set aPreparedStatement
'sIN
parameter.- Specified by:
set
in interfaceBinding<XML,
T> - Parameters:
ctx
- The context object containing all argument objects.- Throws:
SQLException
- Implementations are allowed to pass on allSQLException
s to the caller to be wrapped inDataAccessException
s.
-
get
Description copied from interface:Binding
Get aResultSet
'sOUT
value.Implementations are expected to produce a value by calling
BindingGetResultSetContext.value(Object)
, passing the resulting value to the method.- Specified by:
get
in interfaceBinding<XML,
T> - Parameters:
ctx
- The context object containing all argument objects.- Throws:
SQLException
- Implementations are allowed to pass on allSQLException
s to the caller to be wrapped inDataAccessException
s.
-
get
Description copied from interface:Binding
Get aCallableStatement
'sOUT
value.Implementations are expected to produce a value by calling
BindingGetStatementContext.value(Object)
, passing the resulting value to the method.- Specified by:
get
in interfaceBinding<XML,
T> - Parameters:
ctx
- The context object containing all argument objects.- Throws:
SQLException
- Implementations are allowed to pass on allSQLException
s to the caller to be wrapped inDataAccessException
s.
-
set
Description copied from interface:Binding
Set aSQLOutput
'sIN
parameter.- Specified by:
set
in interfaceBinding<XML,
T> - Parameters:
ctx
- The context object containing all argument objects.- Throws:
SQLException
- Implementations are allowed to pass on allSQLException
s to the caller to be wrapped inDataAccessException
s.
-
get
Description copied from interface:Binding
Get aSQLInput
'sOUT
value.Implementations are expected to produce a value by calling
BindingGetSQLInputContext.value(Object)
, passing the resulting value to the method.- Specified by:
get
in interfaceBinding<XML,
T> - Parameters:
ctx
- The context object containing all argument objects.- Throws:
SQLException
- Implementations are allowed to pass on allSQLException
s to the caller to be wrapped inDataAccessException
s.
-