Top Description Fields Constructors Methods
org.jooq.impl

pack-priv Class ChainedConverterBinding<T, U1, U2>

extends Object
implements Binding<T, U2>
Class Inheritance
All Implemented Interfaces
org.jooq.Binding, java.io.Serializable
Imports
java.sql.SQLException, org.jooq.Binding, .BindingGetResultSetContext, .BindingGetSQLInputContext, .BindingGetStatementContext, .BindingRegisterContext, .BindingSQLContext, .BindingSetSQLOutputContext, .BindingSetStatementContext, .Converter, .Converters

A binding that chains a new converter to an existing binding / converter.
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private final Converter<T, U2>
private final Binding<T, U1>
private final Converter<U1, U2>

Constructor Summary

AccessConstructor and Description
pack-priv
ChainedConverterBinding(Binding<T, U1> delegate, Converter<U1, U2> converter)

Method Summary

Modifier and TypeMethod and Description
public Converter<T, U2>
converter()

Implements org.jooq.Binding.converter.

A converter that can convert between the database type and the custom type.
public void
get(BindingGetResultSetContext<U2>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.get.

Get a ResultSet's OUT value.
public void
get(BindingGetStatementContext<U2>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.get.

Get a CallableStatement's OUT value.
public void
get(BindingGetSQLInputContext<U2>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.get.

Get a SQLInput's OUT value.
public void
register(BindingRegisterContext<U2>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.register.

Register a CallableStatement's OUT parameter.
public void
set(BindingSetStatementContext<U2>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.set.

Set a PreparedStatement's IN parameter.
public void
set(BindingSetSQLOutputContext<U2>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.set.

Set a SQLOutput's IN parameter.
public void
sql(BindingSQLContext<U2>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.sql.

Generate SQL code for the bind variable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chainedback to summary
private final Converter<T, U2> chained
delegateback to summary
private final Binding<T, U1> delegate
suffixback to summary
private final Converter<U1, U2> suffix

Constructor Detail

ChainedConverterBindingback to summary
pack-priv ChainedConverterBinding(Binding<T, U1> delegate, Converter<U1, U2> converter)

Method Detail

converterback to summary
public Converter<T, U2> converter()

Implements org.jooq.Binding.converter.

Doc from org.jooq.Binding.converter.

A converter that can convert between the database type and the custom type.

Annotations
@Override
getback to summary
public void get(BindingGetResultSetContext<U2> ctx) throws SQLException

Implements org.jooq.Binding.get.

Doc from org.jooq.Binding.get.

Get a ResultSet's OUT value.

Implementations are expected to produce a value by calling BindingGetResultSetContext#value(Object), passing the resulting value to the method.

Parameters
ctx:BindingGetResultSetContext<U2>

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:
Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.
getback to summary
public void get(BindingGetStatementContext<U2> ctx) throws SQLException

Implements org.jooq.Binding.get.

Doc from org.jooq.Binding.get.

Get a CallableStatement's OUT value.

Implementations are expected to produce a value by calling BindingGetStatementContext#value(Object), passing the resulting value to the method.

Parameters
ctx:BindingGetStatementContext<U2>

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:
Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.
getback to summary
public void get(BindingGetSQLInputContext<U2> ctx) throws SQLException

Implements org.jooq.Binding.get.

Doc from org.jooq.Binding.get.

Get a SQLInput's OUT value.

Implementations are expected to produce a value by calling BindingGetSQLInputContext#value(Object), passing the resulting value to the method.

Parameters
ctx:BindingGetSQLInputContext<U2>

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:
Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.
registerback to summary
public void register(BindingRegisterContext<U2> ctx) throws SQLException

Implements org.jooq.Binding.register.

Doc from org.jooq.Binding.register.

Register a CallableStatement's OUT parameter.

Parameters
ctx:BindingRegisterContext<U2>

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:
Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.
setback to summary
public void set(BindingSetStatementContext<U2> ctx) throws SQLException

Implements org.jooq.Binding.set.

Doc from org.jooq.Binding.set.

Set a PreparedStatement's IN parameter.

Parameters
ctx:BindingSetStatementContext<U2>

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:
Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.
setback to summary
public void set(BindingSetSQLOutputContext<U2> ctx) throws SQLException

Implements org.jooq.Binding.set.

Doc from org.jooq.Binding.set.

Set a SQLOutput's IN parameter.

Parameters
ctx:BindingSetSQLOutputContext<U2>

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:
Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.
sqlback to summary
public void sql(BindingSQLContext<U2> ctx) throws SQLException

Implements org.jooq.Binding.sql.

Doc from org.jooq.Binding.sql.

Generate SQL code for the bind variable.

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 sql(BindingSQLContext) and set(BindingSetStatementContext), i.e. when bind variables are inlined, then they must not be bound to the PreparedStatement in set(BindingSetStatementContext)

Parameters
ctx:BindingSQLContext<U2>

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:
Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.