Top Description Constructors Methods
org.jooq.impl

public abstract Class AbstractBinding<T, U>

extends Object
implements Binding<T, U>
Class Inheritance
All Implemented Interfaces
org.jooq.Binding, java.io.Serializable
Annotations
@SuppressWarnings:unused
Imports
org.jetbrains.annotations.*, java.sql.SQLData, .SQLException, .SQLFeatureNotSupportedException, org.jooq.Binding, .BindingGetSQLInputContext, .BindingGetStatementContext, .BindingRegisterContext, .BindingSQLContext, .BindingSetSQLOutputContext, org.jooq.conf.ParamType

A convenient base implementation for custom bindings, simplifies the implementation.

The simplification is provided by offering empty implementations for rarely used methods, such as those for stored procedure OUT parameter support:

or SQLData serialisation support (e.g. for Oracle user defined types):

Author
Lukas Eder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
get(BindingGetStatementContext<U>
The context object containing all argument objects.
ctx
)

Implements org.jooq.Binding.get.

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

Implements org.jooq.Binding.get.

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

Implements org.jooq.Binding.register.

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

Implements org.jooq.Binding.set.

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

Implements org.jooq.Binding.sql.

A convenient base implementation that handles the ParamType setting and delegates to sqlInline(BindingSQLContext) or sqlBind(BindingSQLContext) respectively.
protected void
sqlBind(BindingSQLContext<U> ctx)

Generate the SQL string for a bind variable placeholder.

protected void
sqlInline(BindingSQLContext<U> ctx)

Generate the SQL string for inline values.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractBindingback to summary
public AbstractBinding()

Method Detail

getback to summary
public void get(BindingGetStatementContext<U> 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<U>

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<U> 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<U>

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<U> ctx) throws SQLException

Implements org.jooq.Binding.register.

Doc from org.jooq.Binding.register.

Register a CallableStatement's OUT parameter.

Parameters
ctx:BindingRegisterContext<U>

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<U> ctx) throws SQLException

Implements org.jooq.Binding.set.

Doc from org.jooq.Binding.set.

Set a SQLOutput's IN parameter.

Parameters
ctx:BindingSetSQLOutputContext<U>

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<U> ctx) throws SQLException

Implements org.jooq.Binding.sql.

A convenient base implementation that handles the ParamType setting and delegates to sqlInline(BindingSQLContext) or sqlBind(BindingSQLContext) respectively.

Parameters
ctx:BindingSQLContext<U>

Doc from org.jooq.Binding.sql.

The context object containing all argument objects.

Annotations
@Override
Exceptions
SQLException:

Doc from org.jooq.Binding.sql.

Implementations are allowed to pass on all SQLExceptions to the caller to be wrapped in DataAccessExceptions.

sqlBindback to summary
protected void sqlBind(BindingSQLContext<U> ctx) throws SQLException

Generate the SQL string for a bind variable placeholder.

In almost all cases, this can just be a "?" string. In some cases, the placeholder needs to be cast to a vendor specific data type, such as in PostgreSQL, "?::tsvector".

sqlInlineback to summary
protected void sqlInline(BindingSQLContext<U> ctx) throws SQLException

Generate the SQL string for inline values.

The default implementation generates a string literal representation of the user defined value. Custom implementations may want to override this.