public class JsonBinding extends Object implements org.jooq.Binding<Object,Json>
jOOQ Binding
to use json
fields as Json
. When selecting fields, the data is returned as
Json
.
Note that null
values result in a null
object as well, not a Json
object with null
value!
When inputting data (eg. on insert and update), the data is sent as text to the
server, and converted to json there (by adding ::json
to the placeholder).
To use this with the jOOQ code generator, use configuration like this:
<forcedTypes>
<forcedType>
<userType>com.github.t9t.jooq.json.Json</userType>
<binding>JsonBinding</binding>
<types>json</types>
</forcedType>
</forcedTypes>
Constructor and Description |
---|
JsonBinding() |
Modifier and Type | Method and Description |
---|---|
org.jooq.Converter<Object,Json> |
converter() |
void |
get(org.jooq.BindingGetResultSetContext<Json> ctx) |
void |
get(org.jooq.BindingGetSQLInputContext<Json> ctx) |
void |
get(org.jooq.BindingGetStatementContext<Json> ctx) |
void |
register(org.jooq.BindingRegisterContext<Json> ctx) |
void |
set(org.jooq.BindingSetSQLOutputContext<Json> ctx) |
void |
set(org.jooq.BindingSetStatementContext<Json> ctx) |
void |
sql(org.jooq.BindingSQLContext<Json> ctx) |
public void sql(org.jooq.BindingSQLContext<Json> ctx)
public void register(org.jooq.BindingRegisterContext<Json> ctx) throws SQLException
register
in interface org.jooq.Binding<Object,Json>
SQLException
public void set(org.jooq.BindingSetStatementContext<Json> ctx) throws SQLException
set
in interface org.jooq.Binding<Object,Json>
SQLException
public void get(org.jooq.BindingGetResultSetContext<Json> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,Json>
SQLException
public void get(org.jooq.BindingGetStatementContext<Json> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,Json>
SQLException
public void set(org.jooq.BindingSetSQLOutputContext<Json> ctx) throws SQLException
set
in interface org.jooq.Binding<Object,Json>
SQLException
public void get(org.jooq.BindingGetSQLInputContext<Json> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,Json>
SQLException
Copyright © 2019. All rights reserved.