2

For example all generated classes for tables look like that:

SuppressWarnings({"all", "unchecked", "rawtypes"})
public class TableName extends TableImpl<TableNameRecord> {

    private static final long serialVersionUID = 1L;

    public static final TableName TABLE_NAME = new TableName();

    @Override
    public Class<TableNameRecord> getRecordType() {
        return TableNameRecord.class;
    }
   ... (more contructors)  
}

Maven:
Code-generation:

<plugin>
    <groupId>org.jooq</groupId>
    <artifactId>jooq-codegen-maven</artifactId>
    <version>3.16.1</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.3.1</version>
        </dependency>
    </dependencies>
    <configuration>
        <jdbc>
            <driver>org.postgresql.Driver</driver>
            <url>'db-url'</url>
            <user>'user-name'</user>
            <password>'pswd'</password>
        </jdbc>
        <generator>
            <database>
                <name>org.jooq.meta.postgres.PostgresDatabase</name>
                <includes>.*</includes>
                <inputSchema>'my-schema'</inputSchema> 
                <excludes/>
            </database>
            <generate>
                <records>true</records>
            </generate>
            <target>
                <packageName>'package-name'</packageName>
                <directory>target/generated-sources/jooq</directory>
            </target>
        </generator>
    </configuration>
</plugin>

Dependencies: jooq, jooq-meta, jooq-codegen
version: 3.16.1

What's wrong?

Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
alf3ratz
  • 21
  • 5
  • Does your database user have the necessary grants to see the columns? You can check that by querying `information_schema.columns` and `pg_catalog.pg_attribute`. Also, are there any exceptions in the code generation output? – Lukas Eder Jan 14 '22 at 15:33

1 Answers1

0

I added this

<database>
      <includeTables>true</includeTables>
</database>

to configuration and it solved my problem

alf3ratz
  • 21
  • 5
  • That's certainly not a required flag, because it defaults to true. Do you have any parent `pom.xml` or `` or some other reason why the flag may have been deactivated? – Lukas Eder Jan 15 '22 at 09:08