Module org.jooq
Package org.jooq

Interface Binding<T,U>

Type Parameters:
T - The database type - i.e. any type available from SQLDataType
U - The user type
All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractBinding, AbstractXMLasObjectBinding, BlobBinding, ClobBinding, DateAsTimestampBinding, DefaultBinding, LocalDateAsLocalDateTimeBinding, NClobBinding, XMLasDOMBinding

public interface Binding<T,U> extends Serializable
An SPI (Service Provider Interface) that exposes all low-level interactions with JDBC bind variables.

This SPI is used by jOOQ users to implement support for custom data types that would otherwise not be supported by jOOQ and/or JDBC. All of jOOQ's internal support for bind variable types is implemented in DefaultBinding.

When Binding is invoked

A Binding is invoked whenever jOOQ interacts with JDBC's various types, including:

Unlike a Converter, a Binding applies only to JDBC interactions. It does not influence how nested data structures (such as DSL.multiset(TableLike) or DSL.row(SelectField...)) are mapped to Java objects, for example.

Creating user defined DataTypes

jOOQ provides built in data types through SQLDataType. Users can define their own data types programmatically by calling DataType.asConvertedDataType(Converter) or DataType.asConvertedDataType(Binding), for example. Custom data types can also be defined on generated code using the <forcedType/> configuration, see the manual for more details.

Ad-hoc converters allow for attaching a converter directly to a SQL expression in order to keep related logic close together, see the Converter Javadoc for more details.

Author:
Lukas Eder