I have a jOOQ codegen configuration failing because of a function not known by the framework. The configuration is using the org.jooq.meta.extensions.ddl.DDLDatabase
, aiming to generate the code from the Flyway migration scripts. The error is as below:
Error running jOOQ code generation tool: Error while exporting schema: SQL [create table CUSTOMER (ID uuid not null default UUID_GENERATE_V4(), NAME varchar(255) not null, primary key (ID))]; Function "UUID_GENERATE_V4" not found;
By checking the documentation, I see there is a parseUnknownFunctions
parser property that, as far as I understood, is supposed to disable this behaviour when set to IGNORE
. This doesn't seem to have any effect.
I also understand there is a workaround to make jOOQ ignore parts of the SQL file by adding comments on it. This is not possible in my case, as I am not the owner of the SQL files.
Is there any other option I can try?
Below are the script causing the error and the jOOQ config in the pom.xml:
create table customer (
id uuid not null default uuid_generate_v4(),
name varchar(255) not null,
primary key (id)
);
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<executions>
<execution>
<id>generate-jooq-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generator>
<database>
<name>org.jooq.meta.extensions.ddl.DDLDatabase</name>
<inputSchema>PUBLIC</inputSchema>
<outputSchemaToDefault>true</outputSchemaToDefault>
<outputCatalogToDefault>true</outputCatalogToDefault>
<properties>
<property>
<key>sort</key>
<value>semantic</value>
</property>
<property>
<key>scripts</key>
<value>src/main/resources/db/migration/*</value>
</property>
<property>
<key>parseUnknownFunctions</key>
<value>IGNORE</value>
</property>
</properties>
</database>
<target>
<clean>true</clean>
<packageName>com.product</packageName>
<directory>${project.generated-sources}/jooq/src/main/java</directory>
</target>
</generator>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-meta-extensions</artifactId>
<version>${jooq.version}</version>
</dependency>
</dependencies>
</plugin>