public class JsonStringBinding extends Object implements org.jooq.Binding<Object,String>
jOOQ Binding
to use json
fields as String
. When selecting fields, the data
is returned as String
. 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>java.lang.String</userType>
<binding>JsonStringBinding</binding>
<types>json|jsonb</types>
</forcedType>
</forcedTypes>
JsonbStringBinding
,
Serialized FormConstructor and Description |
---|
JsonStringBinding() |
Modifier and Type | Method and Description |
---|---|
org.jooq.Converter<Object,String> |
converter() |
void |
get(org.jooq.BindingGetResultSetContext<String> ctx) |
void |
get(org.jooq.BindingGetSQLInputContext<String> ctx) |
void |
get(org.jooq.BindingGetStatementContext<String> ctx) |
void |
register(org.jooq.BindingRegisterContext<String> ctx) |
void |
set(org.jooq.BindingSetSQLOutputContext<String> ctx) |
void |
set(org.jooq.BindingSetStatementContext<String> ctx) |
void |
sql(org.jooq.BindingSQLContext<String> ctx) |
public void sql(org.jooq.BindingSQLContext<String> ctx)
public void register(org.jooq.BindingRegisterContext<String> ctx) throws SQLException
register
in interface org.jooq.Binding<Object,String>
SQLException
public void set(org.jooq.BindingSetStatementContext<String> ctx) throws SQLException
set
in interface org.jooq.Binding<Object,String>
SQLException
public void get(org.jooq.BindingGetResultSetContext<String> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,String>
SQLException
public void get(org.jooq.BindingGetStatementContext<String> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,String>
SQLException
public void set(org.jooq.BindingSetSQLOutputContext<String> ctx) throws SQLException
set
in interface org.jooq.Binding<Object,String>
SQLException
public void get(org.jooq.BindingGetSQLInputContext<String> ctx) throws SQLException
get
in interface org.jooq.Binding<Object,String>
SQLException
Copyright © 2019. All rights reserved.