Search code examples
javajooqjava-recordjava-15

jOOQ with java 15: both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match


I've just tried upgrading my project to Java 15, and now I get the following error:

  both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match

Does anybody have some experience resolving this issue?


Solution

  • In addition to what Aniket already said:

    Import-on-demand no longer works for Record

    The recommendation is to add an explicit import to your import-on-demand statement:

    import org.jooq.*;
    import org.jooq.Record;
    

    Or to stop using import-on-demand entirely. E.g. in Eclipse, you can use the "Organize Imports" feature to expand all your import-on-demand statements to explicit imports, depending on the types you're actually using.

    Using type inference

    Another way to prevent this problem if it happens with local variables is to use var:

    var record = ctx.fetchOne(TABLE, TABLE.ID.eq(1));
    

    Now you don't have to import the type. This doesn't work with member types, method parameter and return types, of course.

    We'll try to better document this: https://github.com/jOOQ/jOOQ/issues/10646