John Wilson
John Wilson

Reputation: 185

JOOQ 3.1 Code generate just for tables

Is it posible to run the code generator just for tables? I can exclude pkgs fine in <exclude> because they all end with _pkg but i am still generating functions and types as there is no common part in their name.

Upvotes: 0

Views: 851

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 220762

jOOQ 3.8 has added support for code generation flags to turn on/off specific types of generated artefacts (#3482). The configuration is:

<database>
    <includePackages>false</includePackages>
    <includeRoutines>false</includeRoutines>
    ...

Prior to version 3.8, you can still implement your own org.jooq.util.Database, e.g. overriding the OracleDatabase from jOOQ-meta, and then produce only TableDefinition items, none of the other items:

public class NoRoutinesOracleDatabase extends OracleDatabase {
    @Override
    protected List<RoutineDefinition> getRoutines0() {
        return new ArrayList<>();
    }

    // other things you want to prevent...
}

You can then configure the code generator to use that Database:

<configuration>
    <generator>
        <database>
            <name>com.example.NoRoutinesOracleDatabase</name>
            ...

Upvotes: 2

Related Questions