JOOQ Code generation: tinyint to boolean in Gradle plugin

Viewed 284

I tried using this configuration for converting TINYINT(1) to BOOLEAN as per this blog in Gradle plugin https://blog.jooq.org/2019/09/27/how-to-map-mysqls-tinyint1-to-boolean-in-jooq/

database {
     name = 'org.jooq.meta.mysql.MySQLDatabase'
    inputSchema = 'example'
    forcedTypes {
        forcedType {
            name = "BOOLEAN"
            types = "(?i:(TINY|SMALL|MEDIUM|BIG)?INT(UNSIGNED)?\\(1\\))"
        }
    }
}

It doesn't seem to work. The TINYINT(1) type is still generated as Byte and not Boolean.

1 Answers

In my case, the TINYINT was without "(1)", so worked this way (Gradle Groovy DSL):

    forcedTypes {
       forcedType {
           name = 'BOOLEAN'
           includeTypes = '(?i:TINYINT)'
       }
    }

With TINYINT(1) you can use includeTypes = '(?i:TINYINT(1))', without backslash.

Related