jhipster / jhipster-lite

JHipster Lite ⚡ is a development platform to generate, develop & deploy modern web applications & microservices architecture, step by step - using Hexagonal Architecture :gem:
https://lite.jhipster.tech
Apache License 2.0
467 stars 215 forks source link

Module: Jooq #9235

Open murdos opened 8 months ago

murdos commented 8 months ago

Jooq is a nice alternative to JPA. It would be great if jhlite supports it.

If integration of jooq-generator (as build plugin) is possible with liquibase/flyway, that would be awesome (using testcontainers-jooq-codegen-maven-plugin?)

fabienpuissant commented 1 month ago

Started to work on it Configuration seems ok: https://github.com/fabienpuissant/jhipsterlite-jooq/tree/postgres-liquibase

Need to find relevant example to initialize module

Let me know if you use the plugin that way

murdos commented 1 month ago

@fabienpuissant : exemple repo looks fine!

fabienpuissant commented 1 month ago

Not convinced about what to do as an axample for the initialization

Only the configuration without any example is enough ?

Or maybe should I keep a CRUD repository example without the infrastructure primary to avoid RestController ?

murdos commented 1 month ago

Jooq module(s) should not contain any sample code, only all the setup. If you want you can also provide an additional sample module, you can look there are already some.

murdos commented 1 month ago

Regarding modules organisation, here's a proposal:

WDYT?

fabienpuissant commented 1 month ago

I was thinking about that since hibernate config was loaded by default Separate the modules this way seems to be a good idea

But I don't get last two points, I would include testcontainers codegen by default in jooq-xxxxx module no ?

As I understood, jooq need a codegen anyway. So you want to separate the default codegen and the testcontainer codegen in two modules ?

murdos commented 1 month ago

But I don't get last two points, I would include testcontainers codegen by default in jooq-xxxxx module no ?

If you include testcontainers codegen by default in jooq-xxxxx, it means you already have chosen between liquibase and flyway? Or I'm missing something?

As I understood, jooq need a codegen anyway. So you want to separate the default codegen and the testcontainer codegen in two modules ?

Indeed, I would separate things. So you can use jooq-postgresql module, and manually use the official jooq codegen maven plugin rather than the testcontainers one (that only support postgres, mysql and mariadb: no support for mssql e.g.).

BTW we will have to find a gradle equivalent of the testcontainers codegen maven plugin (in a first step we can declare a dependency to maven to explicitly disable gradle)

pascalgrimaud commented 1 month ago

An idea to provide example is to add a small documentation, in a markdown file. It would be enough

fabienpuissant commented 1 month ago

But I don't get last two points, I would include testcontainers codegen by default in jooq-xxxxx module no ?

If you include testcontainers codegen by default in jooq-xxxxx, it means you already have chosen between liquibase and flyway? Or I'm missing something?

As I understood, jooq need a codegen anyway. So you want to separate the default codegen and the testcontainer codegen in two modules ?

Indeed, I would separate things. So you can use jooq-postgresql module, and manually use the official jooq codegen maven plugin rather than the testcontainers one (that only support postgres, mysql and mariadb: no support for mssql e.g.).

BTW we will have to find a gradle equivalent of the testcontainers codegen maven plugin (in a first step we can declare a dependency to maven to explicitly disable gradle)

Yeah my idea was to reduce complexity by including testcontainers codegen directly into jooq-postgresql module for example.

But lets separate different codegens if you think it's needed and I wasn't aware that the testcontainers one is not supporting all db

pascalgrimaud commented 5 days ago

@murdos @fabienpuissant : can it be closed?

fabienpuissant commented 5 days ago

There still a lot to do to fully supports jooq

Gradle compatibility

Liquibase integration

Flyway integration

Using jooq under test container plugin (for maven ans gradle)

murdos commented 5 days ago

@pascalgrimaud : no, there's still some work to do:

pascalgrimaud commented 5 days ago

In this case, maybe we should split into smaller tickets, and link to this one, which will be the main?