Look into these sections: - https://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy/ - https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/
On Tuesday, June 11, 2024, 'Bernd Huber' via jOOQ User Group < [email protected]> wrote: > Im using Mariadb, and the FKs in Mariadb need to be provided with a unique > FK-name. > > see: > - https://mariadb.com/kb/en/foreign-keys/ > - Quote: "The symbol clause, if specified, is used in error messages and > must be unique in the database." > > Sadly (because of this) the jooq-codegen generates path-expression > functions on the Tables that are exactly reflecting this FK-name (which is > often a bit long, and can sometimes get very long). > > For example: > > PRODUCT.fk_product_creatorId().USERID, > PRODUCT.fk_product_editorId().USERID, > PRODUCT_LANG.fk_product_lang_productId().PRODUCTID > > I know that this is a problem of Mariadb/Mysql and probably there can > nothing be done from jooqs side, but i envy other databases, where the fk > function name would be very short and concise. Ideally i would like to see: > > PRODUCT.creator().USERID, > PRODUCT.editor().USERID, > PRODUCT_LANG.product().PRODUCTID > > Is there maybe a trick with the Jooq-Codegen Settings, where one would be > able (with Regex) to replace the Path-Expression Function-Names in the > generated code with such shorter variants ? > > For me the rule could be: > - Take the String after the last "_" > - Cut of any "Id" at the End of the String > > But maybe i just need to accept that MySql/Mariadb are causing the problem > here, and i need to accept for now the long path-expressions :D > > Its not really urgent or important, just some small thing i wonder if it > could be solved. > > Greets, > Bernd > > -- > 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/d951b8e8-65f3-4ac0-86e7-876b5a6514e8n%40googlegroups.com > <https://groups.google.com/d/msgid/jooq-user/d951b8e8-65f3-4ac0-86e7-876b5a6514e8n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAB4ELO6B4ipq1wD5U8b%2Bq3Z5Q331cbw4giu9sjsg_oMirZG8Tg%40mail.gmail.com.
