2,795 questions
2
votes
1
answer
39
views
Jooq get sequence increment
Maybe there's an easier way to get the Increment with JOOQ?
This one looks more like a crutch:
int increment =
Optional.ofNullable(CUSTOMER_ID_SEQ.getIncrementBy())
.map(Field::getName)
...
3
votes
1
answer
38
views
Forcing jOOQ codegen to run despite matching schema version
My new user types were not getting added to the generated model and it took me a good half an hour to understand why.
Steps to reproduce the issue:
Find out about jOOQ codegen being able to check the ...
2
votes
2
answers
57
views
Jooq setNull sets the column to 0 instead of NULL
I'm using Jooq against an Oracle DB with the Jooq CodeGen and Kotlin Generator. The following code should be setting the GROUP_ID to NULL, but instead it is setting the GROUP_ID = 0.
fun ...
3
votes
1
answer
84
views
How to do dynamic projection including related rows in jOOQ
Context: I'm building an HTTP API wrapping a normalized database schema. The database access layer is using jOOQ. For most queries, I have no issues. The problem begins with this type of read access:
...
0
votes
1
answer
28
views
How to unit test a JOOQ result of two TableImpl?
I have two tables
CREATE TABLE PARENT ();
CREATE TABLE CHILD ();
Now I have autogenerated code set up which results in a JOOQ Query like:
create.select(
PARENT,
CHILD)
.from(PARENT).join(...
2
votes
2
answers
92
views
GROUP BY with "?" placeholders for Trino
Problem description in Trino
If the GROUP BY clause contains a ?, the query fails.
ie:
PREPARE stmt FROM
SELECT
IF(origin = ?, 'LI', 'AB'),
SUM(1)
FROM
<catalog>.<table>
WHERE
...
2
votes
0
answers
76
views
How do I query Jooq with "in", whilst also ensuring that the query is case-insensitive?
I'm using Jooq with Java, and I'm trying to query a column, which needs to be case-insensitive, and needs to return all results within a given List<String>.
Having looked around for an answer, ...
0
votes
0
answers
38
views
How to manage predicates with Embeddable types
I have two columns in a database that represent a timestamp
Product ID
CreateDate
CreateTime
1
2024-06-06
020511
2
2025-01-25
230404
CreateDate is a Date field, and CreateTime is a time stored as ...
1
vote
1
answer
49
views
How to write a query with aggregates of json_array_elements in jOOQ
I have this query:
SELECT organisation_id,
count((j->>'invoiceId')) AS count,
sum((j->>'advanceAmount')::numeric(20,4)) AS sum
FROM runs
LEFT JOIN jsonb_array_elements(...
0
votes
0
answers
31
views
Workaround for jooq multiset query with custom type and DataTypeException
The project uses PostgreSQl, and a complex type.
DDL is like:
CREATE TYPE attached_file AS (
id int8,
file_name varchar(255),
file_size int8,
bucket bucket_type);
There is a complex ...
2
votes
1
answer
63
views
How do I add conditions that possibly do not exist
There are some tables like the following in our system: locations, addresses, cities.
The locations has a address_id that refers to addresses, and addresses has city_id that refers to cities.
...
1
vote
0
answers
56
views
Why does jOOQ multiset fail with SQLite when using row(...) and multiset(...) inside findAll()?
I'm using jOOQ (version 3.20.2) with SQLite, and I'm trying to fetch a record along with a multiset of related entries. I know that jOOQ emulates MULTISET via JSON in SQLite, but I get a runtime ...
1
vote
1
answer
72
views
jOOQ fails to parse EXPLAIN ANALYZE with parsing connection
I'm using jOOQ with a parsing connection (withParseDialect(...) and other .withParse...() settings) to log and transform SQL statements.
My connection is initialized with custom settings as shown here:...
0
votes
0
answers
100
views
Are there any jOOQ conventions on how to batch-insert 1 to n relations to the database?
I regularly face the use case in our backend application that it needs to save a lot of data at once that is scattered around multiple tables, but mostly its a 1 to n relationship, or recursive data ...
3
votes
1
answer
439
views
Incorrectly configured jOOQ code generation configuration when running jooq-codegen-maven from command line
I experience trouble to generate jooq classes. I use jooq 3.20.3, with maven, and a db that runs in background.
My configuration is as such:
<build>
<plugins>
<plugin>
...
0
votes
1
answer
123
views
Upsert for Postgres with Jooq 3.16 (open source)
I'm using Jooq, with Postgres (i.e. Postgres dialect)
The project is using Java 11, so, using Jooq Open Source, I'm limited to Jooq 3.16, am using 3.16.23.
I'm trying to do a batch upsert to a ...
2
votes
1
answer
44
views
jOOQ 3.19: Force Record column type for columns matching name format when performing .fetch()
I'm using jOOQ version 3.19 (unable to upgrade to 3.20 as currently on Java 17) and not the codegen library, just the plain org.jooq lib.
I'm reading from a SQLite database which has some Integer ...
2
votes
1
answer
102
views
How to correctly implement jOOQ's Binding to render an alternative PostgreSQL interval bind value syntax
Using Jooq, I would like to bind a custom type for Interval, the dbms is PostgreSQL. In order to do so, I was following this thread, which is trying to achieve the same thing. Unfortunately, my ...
0
votes
1
answer
49
views
Jooq exception when calling Db2 udf
from my spring boot app i'm trying to call a Db2 udf with jooq 3.2.5 (free version) using plain SQL:
@Autowired
private DSLContext context;
@Override
public List<DataItemEntity> find(int ident, ...
1
vote
1
answer
149
views
How to fetch one-to-many nested data in MySQL with jOOQ?
I'm working on a jOOQ query for MySQL where I need to fetch a single row from a main table along with one-to-many related data from two other tables. My schema consists of three tables:
TABLE_A: ...
1
vote
1
answer
270
views
handle null value to non null type kotlin jooq
I have searched this in multiple places but I haven't found or understood the best approach this issue.
I have a query in Jooq with a left join, which results in rows being returned but with null ...
1
vote
1
answer
78
views
How can I resolve a jOOQ codegen error caused by incorrectly quoted identifiers in a deployed Flyway migration file?
I’m using the following environment
Java: 21
Spring Boot: 3.4
JOOQ: 3.19.15 (with jooq-meta-extensions)
Flyway: org.flywaydb:flyway-core:10.20.1 and org.flywaydb:flyway-database-postgresql
The ...
1
vote
1
answer
150
views
jooq json converter not working when query: class org.jooq.JSONB cannot be cast to class java.util.List
I can save data into postgres using jsonConverter with following setting
<forcedType>
<userType>java.util.List<com.sify.MyType></userType>
<jsonConverter&...
1
vote
1
answer
98
views
Standalone selectFrom(table) vs select().from(table)
Using jOOQ 3.19.14 with the PostgreSQL dialect, I had something like this:
dsl.selectFrom(MYRECORD)
.where(some_condition)
.andNotExists(
select()
.from(MYRECORD.as("other&...
0
votes
1
answer
144
views
Does jooq 3.18 or 3.19 support postgres 14
Does the OSS version of Jooq 3.18 or 3.19 support Postgres 14? I was checking https://www.jooq.org/download/support-matrix and it mentions minimum of 15. Does it refer to official support and it will ...