Giter Site home page Giter Site logo

Codegen case sensivity about jooq HOT 4 OPEN

Jouda-Hidri avatar Jouda-Hidri commented on May 19, 2024
Codegen case sensivity

from jooq.

Comments (4)

lukaseder avatar lukaseder commented on May 19, 2024

Thanks for your message. I'm assuming this question is also yours?

Can you please show your complete code generation configuration?

from jooq.

Jouda-Hidri avatar Jouda-Hidri commented on May 19, 2024
project.flyway {
            user = project.rootProject.name
            url = "jdbc:h2:file:${buildDir}/generated/h2/${project.rootProject.name};mode=MySQL;DATABASE_TO_LOWER=TRUE"
            driver = 'org.h2.Driver'
        }
        project.dependencies {
            jooqGenerator 'com.h2database:h2:2.2.224'
        }

        project.jooq {
            version = '3.19.3'
            configurations {
                main {
                    generationTool {
                        jdbc {
                            driver = 'org.h2.Driver'
                            url = project.flyway.url
                            user = project.flyway.user
                        }
                        generator {
                            database {
                                inputSchema = 'public'
                            }
                            target {
                                packageName = project.rootProject.group + '.' + project.name.replaceAll('[-_]', '') + '.jooq'
                                directory = "${buildDir}/generated/source/jooq/main"
                            }
                            generate {
                                javaTimeTypes = false
                            }
                        }
                        logging = 'DEBUG'
                    }
                }
            }
        }

from jooq.

lukaseder avatar lukaseder commented on May 19, 2024

I wonder, is this really a problem caused by jOOQ instead of by your H2 upgrade? I don't see why jOOQ would produce such a change on its own. Does your H2 database produce lower case identifiers when you connect to it (e.g. using Dbeaver) and query the INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.COLUMNS views?

Please note that rather than using H2 to generate code, why not work with testcontainers and an actual MySQL instance. That would also allow you to use vendor specific features not supported by H2's mode=MySQL mode:
https://blog.jooq.org/using-testcontainers-to-generate-jooq-code/

from jooq.

Jouda-Hidri avatar Jouda-Hidri commented on May 19, 2024

Per default H2 tables, columns and schema are UPPER_CASE. I had to change the config for H2 to lower_case and then the schema from 'PUBLIC' to 'public' for JOOQ code-gen.

from jooq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.