r/jOOQ • • Feb 04 '22

When using JOOQ's codegen for generating Entities for Oracle, the data type of fields is Object regardless of the data type in Oracle tables

1 Upvotes

I am using codegen to generate Entities for Oracle from a live connection. The Entities get generated but the data types of the fields corresponding to the columns in the tables is Object except for the oracle type date (maps to java's LocalDate). And a @Deprecated annotation is added to the getter.

I've tried to look in the documentation if I am missing a flag for data type conversion but couldn't find one.

private Object empId; // int in oracle  
private Object empName;  // varchar(50) in oracle
private LocalDate joinDate; // date in oracle 

The jooq codegen version I am using is 3.14.6 (community edition). Am I missing anything in the configuration or is this type mapping not supported for oracle in the community edition?


r/jOOQ • • Jun 22 '22

3.17.0 Release with Computed Columns, Audit Columns, Pattern Matching, Reactive Transactions and Kotlin Coroutine Support

Thumbnail groups.google.com
6 Upvotes

r/jOOQ • • May 02 '25

jOOQ 3.18.30, and 3.19.23, and 3.20.4 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
4 Upvotes

r/jOOQ • • Apr 28 '25

DBO Objects not used in create statements?

2 Upvotes

Am I missing something or are the DBOs unused when calling create statements? It seems like I not only have to define a tables' fields and indexes in the DBO but then I have specify them manually when calling the createTable.

public class PrismMeta extends TableImpl<PrismMetaRecord> { ... }

create.createTableIfNotExists(PRISM_META)
        .column(PRISM_META.META_ID)
        .column(PRISM_META.K)
        .column(PRISM_META.V)
        .primaryKey(PRISM_META.META_ID)
        .unique(PRISM_META.K)
        .execute();

In my experience with other tools I would only need to call create.createTableIfNotExists(PRISM_META) because everything is defined on the dbo.

Same goes for indexes:

    // The definition:
public static final Index PRISM_ACTIVITIES_COORDINATE = Internal.createIndex(
    DSL.name("idx_prism_coordinates"),
    PRISM_ACTIVITIES,
    new OrderField[] { PRISM_ACTIVITIES.X, PRISM_ACTIVITIES.Z, PRISM_ACTIVITIES.Y, PRISM_ACTIVITIES.TIMESTAMP },
    false);

// The create statement:
create.createIndex(Indexes.PRISM_ACTIVITIES_COORDINATE)
  .on(PRISM_ACTIVITIES,
     PRISM_ACTIVITIES.X, PRISM_ACTIVITIES.Y, PRISM_ACTIVITIES.Z, PRISM_ACTIVITIES.TIMESTAMP).execute();

The create calls fail if I attempt to leave off the redundant definitions so it seems like they're required.


r/jOOQ • • Jan 30 '26

jOOQ 3.18.37, and 3.19.30, and 3.20.11 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
5 Upvotes

r/jOOQ • • Jun 11 '25

jOOQ 3.18.31, and 3.19.24, and 3.20.5 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
7 Upvotes

r/jOOQ • • Nov 04 '25

Jooq multiset and postgres ma 100 number of function args

2 Upvotes

Hello! I am successfully using jooq multiset feature to fetch records and their "relatives" as subsets. But I after facing a problem: whenever we need to fetch nire than 100 columns, multiset breaks on postgres. Multiset uses json aggregate functions to combine sub-rows into single column. When the requested amount of columns is > 100 then it no longer works (postgres throws exception).

Is there a way to workaround this? If multiset had used selected fields inside array then max args limit would not apply.

Regards


r/jOOQ • • Apr 28 '25

Checking for tables or index before creating them?

3 Upvotes

What's the best approach (that works for mysql/maria, postgres, sqlite, and h2) to check a table and/or it's indexes before calling create statements?

I've realized that the createTable()....indexes() feature doesn't work in sqlite and there's no "create index if not exists" method in jooq.

I've been able to get away with not checking first for tables and procedures using the IF NOT EXISTS clause.

So far the only approach I'm seeing is to manually query each in the various ways each database type supports to check for the tables/indexes.


r/jOOQ • • Mar 27 '25

Think About SQL MERGE in Terms of a RIGHT JOIN

Thumbnail
blog.jooq.org
2 Upvotes

r/jOOQ • • Apr 03 '25

jOOQ 3.18.29, and 3.19.22, and 3.20.3 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
7 Upvotes

r/jOOQ • • Jun 04 '26

jOOQ 3.19.35, 3.20.16, and 3.21.5 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
3 Upvotes

r/jOOQ • • Jul 09 '25

Ambiguous match found for columns with a third join, but not for two

2 Upvotes

I'm confused about the reason duplicate column names from aliased tables are suddenly an issue now that I've gone from 2 to 3.

I have a `prism_blocks` table that I left join. Previously, it was joined twice - once normally and once aliased as `replaced_blocks`. This worked fine both in jooq code and in the query.

// Table objects/aliasing
PRISM_BLOCKS 
= new PrismBlocks(prefix);PRISM_BLOCKS = new PrismBlocks(prefix);
REPLACED_BLOCKS = PRISM_BLOCKS.as("replaced_blocks");

// Joins used in my query
queryBuilder.addJoin(
    PRISM_BLOCKS,
    JoinType.LEFT_OUTER_JOIN,
    PRISM_BLOCKS.BLOCK_ID.equal(PRISM_ACTIVITIES.BLOCK_ID)
);

queryBuilder.addJoin(
    REPLACED_BLOCKS,
    JoinType.LEFT_OUTER_JOIN,
    REPLACED_BLOCKS.BLOCK_ID.equal(PRISM_ACTIVITIES.REPLACED_BLOCK_ID)
);

// Later when I get the values:
String translationKey = r.getValue(PRISM_BLOCKS.TRANSLATION_KEY);
String replacedBlockTranslationKey = r.getValue(REPLACED_BLOCKS.TRANSLATION_KEY);

However, now I'm adding a third join of the same table to a new foreign key:

// The alias:
this.CAUSE_BLOCKS = PRISM_BLOCKS.as("cause_blocks");

// The join:
queryBuilder.addJoin(
    CAUSE_BLOCKS,
    JoinType.LEFT_OUTER_JOIN,
    CAUSE_BLOCKS.BLOCK_ID.equal(PRISM_ACTIVITIES.CAUSE_BLOCK_ID)
);

// Reading the value:
String causeTranslationKey = r.getValue(CAUSE_BLOCKS.TRANSLATION_KEY);

The query works fine, but JOOQ throws an error when I try to read the result:

Ambiguous match found for "replaced_blocks"."translation_key". Both "prism_blocks"."translation_key" and "cause_blocks"."translation_key"

If I create an alias of the actual fields, like this, it works fine. So why wasn't this an issue before with two columns? Is the table alias not enough?

CAUSE_BLOCKS.TRANSLATION_KEY.as("cause_block_translation_key");CAUSE_BLOCKS.TRANSLATION_KEY.as("cause_block_translation_key");

r/jOOQ • • Oct 01 '25

jOOQ 3.18.34, 3.19.27, and 3.20.8 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
4 Upvotes

r/jOOQ • • Oct 29 '26

jOOL 0.9.16 released with some minor improvements and fixes

Thumbnail
github.com
4 Upvotes

r/jOOQ • • Feb 10 '26

I built a test data factory for jOOQ — generates valid entities in one line, resolves FKs automatically

2 Upvotes

Hey everyone,

I got tired of writing 30+ lines of setup code for every integration test — manually creating parent entities, setting NOT NULL fields, dealing with foreign keys. So I built Joot, a small library that auto-generates test data using jOOQ's schema metadata.

The basic idea:

// Instead of manually creating Author, then Book with correct FK...
Book book = ctx.create(BOOK, Book.class).build();
// Author auto-created, FK resolved, all NOT NULL fields populated

It reads your jOOQ-generated code to understand table structure, foreign keys, column types, and constraints — then generates realistic values automatically.

Some things it does:

  • Auto FK resolution — creates parent entities recursively

  • Factory definitions — ctx.define(AUTHOR, f -> { ... }) for reusable defaults

  • Traits — named variations: .trait("european")

  • Custom generators — per-field or per-type: ctx.registerGenerator(AUTHOR.EMAIL, (maxLen, isUnique) -> "[email protected]")

  • Sequences — ctx.sequence(AUTHOR.EMAIL, n -> "author" + n + "@test.com")

  • Batch creation — .times(10)

  • Handles circular refs — breaks cycles in schemas like company ↔ person

It's type-safe (uses jOOQ's Field<T> and Table<R>), works with any database that jOOQ supports, and it's on Maven Central.

GitHub: https://github.com/jtestkit/joot

Would love to hear feedback from the jOOQ community — what's missing? What would make this more useful for your projects?


r/jOOQ • • Aug 04 '26

jOOQ 3.19.37, 3.20.18, and 3.21.7 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
5 Upvotes

r/jOOQ • • Aug 20 '25

jOOQ MCP Server available

3 Upvotes

I've created an MCP server that serves the jOOQ documentation:

https://jooq-mcp.fly.dev


r/jOOQ • • Oct 16 '26

jOOX 2.0.2 released with some minor improvements and fixes

Thumbnail github.com
2 Upvotes

r/jOOQ • • Apr 16 '26

jOOQ 3.19.32, 3.20.13, and 3.21.2 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
5 Upvotes

r/jOOQ • • Oct 12 '26

jOOR 0.9.16 released with some minor improvements and fixes

Thumbnail github.com
2 Upvotes

r/jOOQ • • May 12 '26

jOOQ 3.19.34, 3.20.15, and 3.21.4 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
3 Upvotes

r/jOOQ • • Mar 26 '26

jOOQ 3.21.1 patch releases with minor improvements and bug fixes

Thumbnail groups.google.com
3 Upvotes

r/jOOQ • • Jul 06 '21

3.15.0 Release with Support for R2DBC, Nested ROW, ARRAY, and MULTISET types, 5 new SQL dialects, CREATE PROCEDURE, FUNCTION, and TRIGGER support and Much More

Thumbnail
blog.jooq.org
9 Upvotes

r/jOOQ • • Dec 07 '21

jOOQ and latest H2 (2.0.202)

2 Upvotes

Howdy, it seems jooq dislikes the latest H2 release (that to be frank, has a LOT of changes, many of them trying to get back to "standard SQL").

Any plans to re-marry jooq and latest 2.x branch of H2?