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
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
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
sorry following correction to the second MatcherStrategy example.
I tried it like this:
.withFields(
new MatchersFieldType()
.withFieldIdentifier(new
MatcherRule()
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,