You're probably using H2 or some implementation that uses H2 behind the
scenes, like DDLDatabase or JPADatabase? You could implement your own
generator strategy:

- Programmatic
https://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy/
- Configurative
https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/

Or use your actual target database instead for code generation.
Thanks,
Lukas

On Thu, Sep 16, 2021 at 6:28 PM 'Gang Luo' via jOOQ User Group <
jooq-user@googlegroups.com> wrote:

> Hi folks,
>
> One of the file auto-generated by JOOQ is "Indexes.java". Inside it there
> are primary keys defined like "PRIMARY_KEY_302". That "302" in the name
> seems a bit random to me. I am wondering where does it come from. Of course
> to say it is random is incorrect, as I rerun the code gen multiple times it
> alway produce the same variable names.
>
> The reason I ask is because I am generating two set of code from two
> different DB schema, A and B. Both schema has exactly the same tables and
> specs/schema, so I expect the code generated from them, specifically for
> that "Indexes.java", will be the same. The reality is, they are 99% the
> same. For that 1% difference they are actually "similar" but just not the
> same. Following are the example of 3 variables generated from the schema A
> and B that don't match exactly.
>
> PRIMARY_KEY_EE -- PRIMARY_KEY_E
>
> PRIMARY_KEY_3 -- PRIMARY_KEY_30
>
> PRIMARY_KEY_30 -- PRIMARY_KEY_302
>
> I am wondering why is that and how can I have both generate the exactly
> same variables in "Indexes.java".
>
> Thanks.
>
> -Gang
>
> --
> 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 jooq-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/4ae90136-0831-402e-add7-970c6e8228c9n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/4ae90136-0831-402e-add7-970c6e8228c9n%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 jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO7p4VHr1WShpFQaZ6Da%2BHtsr%2BZuWF4bprP%2BCNNGvAmazg%40mail.gmail.com.

Reply via email to