Can JOOQ be used without code generation?

前端 未结 1 757
失恋的感觉
失恋的感觉 2021-01-17 17:51

I am assessing JOOQ for use in a new system that is still under development. I would like to avoid code generation when the database is being developed along with the applic

1条回答
  •  被撕碎了的回忆
    2021-01-17 18:26

    Is JOOQ appropriate for the above use case?

    Yes, many jOOQ users use only the runtime library without the code generator. Examples can be seen in the getting started guide.

    Is there a java DSL for schema definition?

    jOOQ wraps JDBC's DatabaseMetaData in org.jooq.Meta, which you can access via DSLContext.meta(). The objects returned from Meta are again jOOQ's Schema, Table, Field objects, which you can use with the rest of the API.

    Using the code generator with a Java-driven database schema

    On a side note, Vlad Mihalcea has written this very interseting blog post about how to use the jOOQ code generator in a Hibernate project, where the database is driven by the JPA-annotated Java model. Maybe that is useful to you as well.

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