Skip to content

Tag: jooq

jOOQ JSON query results in ORA-00979

I’m trying to execute this query to an Oracle 19c database: But I get Does jOOQs JSON feature not work with Oracle? Answer This isn’t related to your JSON usage. The same thing would have happened if you removed all of it and wrote this query instead: Your query would work in MySQL, PostgreSQL or …

JOOQ materialized views

is it possible to create materialized views using the JOOQ builder? Something like this Answer In jOOQ 3.14, not yet: https://github.com/jOOQ/jOOQ/issues/9483 But you can use plain SQL templating to work around this limitation, to at least get some type safety in your statement:

Is there a way to query ltrees in JOOQ?

Is there any sort of extension that would allow me to use Postgres ltrees in JOOQ without having to use raw SQL? Any way to make one myself maybe? Answer Starting from jOOQ 3.17: With #13188, jOOQ has added native support for LTREE types (and similar) via the jooq-postgres-extensions module: Just add that mod…

Jooq Java CTE wrong render

I have CTE that is been creating from DSL.values: Then i am trying use it to get needed values from DB But i have only the next error I suppose it happens because of (select * from (values(cast(? as varchar)) How to fix it? Other methods without cte work fine. Answer The problem was there: “Id” is…

JOOQ – inline Converter not being applied

In my build.gradle I use a converter in my forcedTypes. This works fine where i need it. However, I am trying to convert a comma separated string into a list of enums for a specificuse case: This throws an exception This is the model I am fetching into: Am I missing something? UPDATE: I am able to convert inl…

jooq query for sql query with analytical function

i have sql query like i need to write in jOOQ, any help. I tried the below Also,is there any way to avoid listing all columns in select. Instead of Something like Answer A derived table can be constructed like this: Also, is there any way to avoid listing all columns in select You’re looking for Table.a…

JOOQ: How to resolve foreign keys as objects?

Say I have a table that references another table, in this case “TestScenarios” references “TestSchemas”. So each TestScenario HAS-A TestSchema. I autogenerated DAOs, however, when fetching TestScenario instance via the DAO the TestSchema field is an integer, not a TestSchema-object. Ho…