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. One only needs different setups of the generator, one using the database as a source, another one using the XML-schema. That might contain CTE-"tables" for all CTEs of all queries following some naming scheme or one could create individual schemata for individual queries. The generator restricts its output to only one target package currently and stuff like that, while I most likely have many different CTEs in many different queries in many different packages. 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. Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: [email protected] AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...........05151- 9468- 55 Fax...............05151- 9468- 88 Mobil..............0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow -- 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/63303988.20200207161541%40am-soft.de.
de.am_soft.sm_mtg.backend.daos.db.jooq.ctes.launch
Description: Binary data
code_gen.xml
Description: XML document
logback.xml
Description: XML document
schema.xml
Description: XML document
<<attachment: ctes.zip>>
