SQLDataType
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.
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
| Modifier and Type | Method and Description |
|---|---|
| public @NotNull Converter | |
| public void | get(BindingGetResultSetContext<U>
The context object containing all argument objects. ctx)Get a |
| public void | get(BindingGetStatementContext<U>
The context object containing all argument objects. ctx)Get a |
| public void | get(BindingGetSQLInputContext<U>
The context object containing all argument objects. ctx)Get a |
| public static <T, U> @NotNull Binding | of(Converter<T, U> converter, Consumer<? super BindingSQLContext<U>> sqlContext, Consumer<? super BindingGetResultSetContext<U>> getResultSetContext, Consumer<? super BindingSetStatementContext<U>> setStatementContext)
Construct a binding from functions. |
| public static <T, U> @NotNull Binding | of(Converter<T, U> converter, Consumer<? super BindingSQLContext<U>> sqlContext, Consumer<? super BindingGetResultSetContext<U>> getResultSetContext, Consumer<? super BindingSetStatementContext<U>> setStatementContext, Consumer<? super BindingRegisterContext<U>> registerContext, Consumer<? super BindingGetStatementContext<U>> getStatementContext)
Construct a binding from functions. |
| public static <T, U> @NotNull Binding | of(Converter<T, U> converter, Consumer<? super BindingSQLContext<U>> sqlContext, Consumer<? super BindingGetResultSetContext<U>> getResultSetContext, Consumer<? super BindingSetStatementContext<U>> setStatementContext, Consumer<? super BindingRegisterContext<U>> registerContext, Consumer<? super BindingGetStatementContext<U>> getStatementContext, Consumer<? super BindingGetSQLInputContext<U>> getSqlInputContext, Consumer<? super BindingSetSQLOutputContext<U>> setSqlOutputContext)
Construct a binding from functions. |
| public void | register(BindingRegisterContext<U>
The context object containing all argument objects. ctx)Register a |
| public void | set(BindingSetStatementContext<U>
The context object containing all argument objects. ctx)Set a |
| public void | set(BindingSetSQLOutputContext<U>
The context object containing all argument objects. ctx)Set a |
| public void | sql(BindingSQLContext<U>
The context object containing all argument objects. ctx)Generate SQL code for the bind variable. |
| converter | back to summary |
|---|---|
| public @NotNull Converter A converter that can convert between the database type and the custom type.
| |
| get | back to summary |
|---|---|
| public void get(BindingGetResultSetContext<U> ctx) throws SQLException Get a
Implementations are expected to produce a value by calling
| |
| get | back to summary |
|---|---|
| public void get(BindingGetStatementContext<U> ctx) throws SQLException Get a
Implementations are expected to produce a value by calling
| |
| get | back to summary |
|---|---|
| public void get(BindingGetSQLInputContext<U> ctx) throws SQLException Get a
Implementations are expected to produce a value by calling
| |
| of | back to summary |
|---|---|
| public static <T, U> @NotNull Binding Construct a binding from functions.
| |
| of | back to summary |
|---|---|
| public static <T, U> @NotNull Binding Construct a binding from functions.
| |
| of | back to summary |
|---|---|
| public static <T, U> @NotNull Binding Construct a binding from functions.
| |
| register | back to summary |
|---|---|
| public void register(BindingRegisterContext<U> ctx) throws SQLException Register a
| |
| set | back to summary |
|---|---|
| public void set(BindingSetStatementContext<U> ctx) throws SQLException Set a
| |
| set | back to summary |
|---|---|
| public void set(BindingSetSQLOutputContext<U> ctx) throws SQLException Set a
| |
| sql | back to summary |
|---|---|
| public void sql(BindingSQLContext<U> ctx) throws SQLException Generate SQL code for the bind variable.
Implementations should generate SQL code onto
Implementations must provide consistent behaviour between
| |