Top Description Fields Constructors Methods
org.jooq.impl

public Class DateAsTimestampBinding

extends Object
implements Binding<Timestamp, Timestamp>
Class Inheritance
All Implemented Interfaces
org.jooq.Binding, java.io.Serializable
Static Imports
org.jooq.impl.DSL.val, .SQLDataType.DATE

A binding that implements the date-as-timestamp semantics of the jOOQ code generator.
Author
Lukas Eder
See Also
https://github.com/jOOQ/jOOQ/issues/3369

Field Summary

Modifier and TypeField and Description
private final Converter<Timestamp, Timestamp>
private final Binding<Timestamp, Timestamp>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final Converter<Timestamp, Timestamp>
converter()

Implements org.jooq.Binding.converter.

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

Implements org.jooq.Binding.get.

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

Implements org.jooq.Binding.get.

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

Implements org.jooq.Binding.get.

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

Implements org.jooq.Binding.register.

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

Implements org.jooq.Binding.set.

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

Implements org.jooq.Binding.set.

Set a SQLOutput's IN parameter.
public final void
sql(BindingSQLContext<Timestamp>
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

converterback to summary
private final Converter<Timestamp, Timestamp> converter
delegateback to summary
private final Binding<Timestamp, Timestamp> delegate

Constructor Detail

DateAsTimestampBindingback to summary
public DateAsTimestampBinding()

Method Detail

converterback to summary
public final Converter<Timestamp, Timestamp> 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 final void get(BindingGetResultSetContext<Timestamp> 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<Timestamp>

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 final void get(BindingGetStatementContext<Timestamp> 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<Timestamp>

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 final void get(BindingGetSQLInputContext<Timestamp> 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<Timestamp>

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 final void register(BindingRegisterContext<Timestamp> ctx) throws SQLException

Implements org.jooq.Binding.register.

Doc from org.jooq.Binding.register.

Register a CallableStatement's OUT parameter.

Parameters
ctx:BindingRegisterContext<Timestamp>

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 final void set(BindingSetStatementContext<Timestamp> ctx) throws SQLException

Implements org.jooq.Binding.set.

Doc from org.jooq.Binding.set.

Set a PreparedStatement's IN parameter.

Parameters
ctx:BindingSetStatementContext<Timestamp>

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 final void set(BindingSetSQLOutputContext<Timestamp> ctx) throws SQLException

Implements org.jooq.Binding.set.

Doc from org.jooq.Binding.set.

Set a SQLOutput's IN parameter.

Parameters
ctx:BindingSetSQLOutputContext<Timestamp>

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 final void sql(BindingSQLContext<Timestamp> 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<Timestamp>

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.