Daniel Einspanjer
2017-05-08 04:24:21 UTC
I was struggling a bit with this over the weekend. FOO is a table with a
column BAR which is a JSONB type field.
I have the generator hooked up with Gson and the signature for FOO.BAR is a
JsonElement.
For an example, a row in the table might have the jsonb value for bar:
{"a": 1, "b": 2}
And my sourceKey JsonObject would be {"b": 2}
Kept getting errors such as:
WARN Caused by: org.jooq.exception.SQLDialectNotSupportedException: Type
class com.google.gson.JsonObject is not supported in dialect DEFAULT
I tried a few different ways:
.where(DSL.sql("{0} @> {1}", FOO.BAR,
DSL.val(sourceKey)))
.where(DSL.sql("{0} @> {1}", FOO.BAR,
DSL.val(sourceKey)))
.where(DSL.sql("{0} @> {1}::jsonb", FOO.BAR,
DSL.val(sourceKey.toString())))
column BAR which is a JSONB type field.
I have the generator hooked up with Gson and the signature for FOO.BAR is a
JsonElement.
For an example, a row in the table might have the jsonb value for bar:
{"a": 1, "b": 2}
And my sourceKey JsonObject would be {"b": 2}
Kept getting errors such as:
WARN Caused by: org.jooq.exception.SQLDialectNotSupportedException: Type
class com.google.gson.JsonObject is not supported in dialect DEFAULT
I tried a few different ways:
.where(DSL.sql("{0} @> {1}", FOO.BAR,
DSL.val(sourceKey)))
.where(DSL.sql("{0} @> {1}", FOO.BAR,
DSL.val(sourceKey)))
.where(DSL.sql("{0} @> {1}::jsonb", FOO.BAR,
DSL.val(sourceKey.toString())))
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.