public class JsonbBinding extends Object implements org.jooq.Binding<Object,Jsonb>
jOOQ Binding
to use jsonb
fields as Jsonb
. When selecting fields, the data is returned as
Jsonb
.
Note that null
values result in a null
object as well, not a Jsonb
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.Jsonb</userType>
<binding>JsonbBinding</binding>
<types>jsonb</types>
</forcedType>
</forcedTypes>
Constructor and Description |
---|
JsonbBinding() |
Modifier and Type | Method and Description |
---|---|
org.jooq.Converter<Object,Jsonb> |
converter() |
void |
get(org.jooq.BindingGetResultSetContext<Jsonb> ctx) |
void |
get(org.jooq.BindingGetSQLInputContext<Jsonb> ctx) |
void |
get(org.jooq.BindingGetStatementContext<Jsonb> ctx) |
void |
register(org.jooq.BindingRegisterContext<Jsonb> ctx) |
void |
set(org.jooq.BindingSetSQLOutputContext<Jsonb> ctx) |
void |
set(org.jooq.BindingSetStatementContext<Jsonb> ctx) |
void |
sql(org.jooq.BindingSQLContext<Jsonb> ctx) |
public void sql(org.jooq.BindingSQLContext<Jsonb> ctx)
public void register(org.jooq.BindingRegisterContext<Jsonb> ctx) throws SQLException
register
in interface org.jooq.Binding<Object,Jsonb>
SQLException
public void set(org.jooq.BindingSetStatementContext<Jsonb> ctx) throws SQLException
set
in interface org.jooq.Binding<Object,Jsonb>
SQLException
public void get(org.jooq.BindingGetResultSetContext<Jsonb> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,Jsonb>
SQLException
public void get(org.jooq.BindingGetStatementContext<Jsonb> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,Jsonb>
SQLException
public void set(org.jooq.BindingSetSQLOutputContext<Jsonb> ctx) throws SQLException
set
in interface org.jooq.Binding<Object,Jsonb>
SQLException
public void get(org.jooq.BindingGetSQLInputContext<Jsonb> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,Jsonb>
SQLException
Copyright © 2019. All rights reserved.