Disambiguate table with name `object` in Jooq CodeGen

21 views
Skip to first unread message

Shyam

unread,
Aug 3, 2024, 3:23:29 PM8/3/24
to jOOQ User Group
I am updating my projects from Jooq 3.14.16 to Jooq 3.19.10
I am using codegen tool to generate Java source for jooq entities.

In the Postgres DB schema there are several tables and one of them is named `object`.

After moving to Jooq 3.19.10, generated entities fail to compile with error "method does not override or implement a method from a supertype".

Steps to reproduce:
Create atleast 2 tables, one of them with name `object`, as;
CREATE TABLE jooqtest.account (
  id INT,
  details VARCHAR(32)
);

CREATE TABLE jooqtest.object (
  obj_id INT,
  details VARCHAR(32)
);

After generating jooq entity files,
In tables/Account.java method override looks like below,
    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public Account where(@Stringly.SQL String condition, Object... binds) {
        return where(DSL.condition(condition, binds));
    }

Whereas, in tables/Object.java it looks like,
    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public Object where(@Stringly.SQL String condition, java.lang.Object... binds) {
        return where(DSL.condition(condition, binds));
    }

Here the Object in Account class is not able to resolve to java.lang.Object
Hence compiler throws error.

Kindly suggest if there is any way to resolve it without renaming tables in my DB?
Is there is any setting in codeGen that I can configure?

Lukas Eder

unread,
Aug 5, 2024, 3:28:49 AM8/5/24
to jooq...@googlegroups.com
Thanks for your message. Let's discuss on your cross-posted question here:

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/f2774927-8195-46c1-87ad-5d786e7f6252n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages