Cannot compile autogenerated JOOQ code because of multiple java errors

Tobias Marschall :

I used java --add-modules java.xml.bind -classpath jooq-3.11.3.jar;jooq-meta-3.11.3.jar;jooq-codegen-3.11.3.jar;postgresql-42.2.4.jar;. org.jooq.codegen.GenerationTool jooq.xml to autogenerate JOOQ code for my PostgreSQL 10 USER table.

pgadmin4_2018-07-24_08-08-49

The codegen tool finishes successfully however my program won´t compile because there are several Java syntax errors in the autogenerated code.

Some examples:

PgClass.java

/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using <deprecationOnUnknownTypes/> in your code generator configuration.
*/
@java.lang.Deprecated
public final TableField<PgClassRecord, Object> RELPARTBOUND = createField("relpartbound", , this, "");

idea64_2018-07-24_08-12-48

The compiler is telling me java: illigal start of expression

PgIndex.java:

/**
* The column <code>pg_catalog.pg_index.indoption</code>.
*/
public final TableField<PgIndexRecord, Object[]> INDOPTION = createField("indoption", .getArrayDataType(), this, "");

idea64_2018-07-24_08-15-31

The compiler is telling me java: as of release 8, 'this' is allowed as the parameter name for the receiver type only, which has to be the first parameter

EDIT:

jooq.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd">
  <jdbc>
    <driver>org.postgresql.Driver</driver>
    <url>jdbc:postgresql://localhost:5432/timecoder-api-dev</url>
    <user>postgres</user>
    <password></password>
  </jdbc>

  <generator>
    <database>
      <name>org.jooq.meta.postgres.PostgresDatabase</name>
      <includes>.*</includes>
    </database>
    <target>
      <packageName>persistence.database.generated</packageName>
      <directory>K:\Data\Dev\Git\timecoder-api\src</directory>
    </target>
  </generator>
</configuration>
  • jOOQ: 3.11.3
  • Java: 1.8.0_181
  • Database (include vendor): PostgreSQL 10
  • OS: Windows 10

I also created an issue on GitHub: https://github.com/jOOQ/jOOQ/issues/7684

Lukas Eder :

Thanks for reporting. This is a bug in the code generator: https://github.com/jOOQ/jOOQ/issues/7692

It will be fixed in jOOQ 3.12.0 and 3.11.4

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=77885&siteId=1