Codegenerated Path-Expressions with Databases (Mariadb, Mysql) that have unique FK-names

2024-06-11 Thread 'Bernd Huber' via jOOQ User Group
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-e

Re: Codegenerated Path-Expressions with Databases (Mariadb, Mysql) that have unique FK-names

2024-06-11 Thread Lukas Eder
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 < jooq-user@googlegroups.com> wrote: > Im

Re: Codegenerated Path-Expressions with Databases (Mariadb, Mysql) that have unique FK-names

2024-06-11 Thread 'Bernd Huber' via jOOQ User Group
thank you Lukas, im currently using a custom GeneratorStrategy. It seems when i use a custom GeneratorStrategy i can not additionally use the Matchers. I read about it in following page: https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/ Quote: - "...Instead of s

Re: Codegenerated Path-Expressions with Databases (Mariadb, Mysql) that have unique FK-names

2024-06-11 Thread 'Bernd Huber' via jOOQ User Group
sorry following correction to the second MatcherStrategy example. I tried it like this: .withFields( new MatchersFieldType() .withFieldIdentifier(new MatcherRule()

Re: Codegenerated Path-Expressions with Databases (Mariadb, Mysql) that have unique FK-names

2024-06-12 Thread 'Bernd Huber' via jOOQ User Group
i got it to work now with the Custom GeneratorStrategy! :) public final class FkGeneratorStrategy extends DefaultGeneratorStrategy { private static Pattern FK_PATTERN = Pattern.compile("^(.*)_(.*?)(Id)?$"); ... @Override public String getJavaMethodName(Definition definition,