On Fri, Feb 7, 2020 at 4:15 PM Thorsten Schöning <[email protected]> wrote:
> Guten Tag Thorsten Schöning, > am Freitag, 31. Januar 2020 um 19:06 schrieben Sie: > > > I tried following the approach jOOQ is doing by simply creating > > classes with fields for each CTE and their columns.[...] > > One can get exactly what jOOQ does by using the code generator with a > schema for a XMLDatabase: > > https://www.jooq.org/doc/latest/manual/code-generation/codegen-xml/ > > That schema would need to describe the name of the CTE and its columns > and jOOQ would simply generate code for that like it does with tables > from a database. In other messages of this thread, Lukas Eder > suggested to implement CustomTable instead of using a class with names > and fields only like I did, so using the generator directly is pretty > close. > Yeah, why not. Or you could use the DDLDatabase, which might make the definition of your "CTE" a bit more concise. > Managing all those different tables isn't that easy currently: Things > are tables for the generator, so classes are put into packages like > "[...].ctes.tables[.records]". While one might prefer something like > "[...].ctes[.records]" directly only. That way one might mix things > into other jOOQ-packages, like in the following example: > > > [...].db.jooq > > [...].db.jooq.ctes > > [...].db.jooq.ctes.tables > > [...].db.jooq.ctes.tables.records > > [...].db.jooq.enums > > [...].db.jooq.tables > > [...].db.jooq.tables.record > > I'm attaching my generated files and their config for references, > maybe someone finds that approach interesting. > Please also have a look at generator strategies: https://www.jooq.org/doc/3.12/manual/code-generation/codegen-generatorstrategy/ https://www.jooq.org/doc/3.12/manual/code-generation/codegen-matcherstrategy/ -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO6y%3DCA0ZrbmyxbT%3Db81m7P_b5SibH_BZqHz05o5tiUnRQ%40mail.gmail.com.
