Unable to generate Jooq Classes from H2 using JPADatabase

后端 未结 1 1880
北海茫月
北海茫月 2021-01-24 05:36

Im currently trying to generate jooq classes from jpa entities instead of using an existing db.

Following this page and using jooq version 3.9.1, my current pom\'s plugi

相关标签:
1条回答
  • 2021-01-24 05:50

    Your entities are probably located in the same module as where you put the plugin. This means that the jOOQ code generator is called prior to compiling the module, which means that the JPA-annotated entities are not yet compiled when the jOOQ code generator tries to find them.

    The solution is to create the following module dependency graph:

                            +-------------------+
                            | Your JPA entities |
                            +-------------------+
                                 ^         ^
                      depends on |         | depends on
                                 |         |
              +---------------------+   +---------------------+
              | jOOQ codegen plugin |   | Your application    |
              +---------------------+   +---------------------+
                                 |         |
                       generates |         | depends on
                                 v         v
                         +-------------------------+
                         | jOOQ generated classes  |
                         +-------------------------+
    

    I've registered an issue to improve the documentation in order to clarify this: https://github.com/jOOQ/jOOQ/issues/6011

    0 讨论(0)
提交回复
热议问题