Thank you for the response. I understand that this is a bug. For now, 
I'll try the suggested method and see how it goes.  
2024年10月28日月曜日 16:11:22 UTC+9 lukas...@gmail.com:

> Thanks for your message. I'd say, this is a bug. You shouldn't be getting 
> this warning in that case, given that the keys are generated into different 
> Keys classes from different packages:
> https://github.com/jOOQ/jOOQ/issues/17505
>
> As documented here:
>
> https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/codegen-matcher-foreign-keys/
>
> Just add the expression (regular expression matching keys in your schema) 
> and the matcher rule for the keyIdentifier:
>
> https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/codegen-matcher-rule/
>
> e.g.
>
> foreignKey {
>   expression = ".."
>   keyIdentifier {
>     transform = "UPPER"
>     expression = "PREFIX_$0"
>   }
> }
>
> The only way to automatically include the schema name is to repeat this 
> configuration for each schema, or to create a programmatic configuration 
> instead:
>
> https://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy/
>
>
> On Mon, Oct 28, 2024 at 7:52 AM k s <system....@gmail.com> wrote:
>
>> Hello,
>>
>> I'm encountering a warning due to ambiguous key names generated by jOOQ 
>> during code generation. The issue arises from foreign keys across different 
>> schemas having identical method names. Here's an example:
>>
>> - `main.users.service_id` references `main.service.service_id` as 
>> `USERS__USERS_SERVICE_ID_FKEY`
>> - `schema_a.users.service_id` also references `main.service.service_id`, 
>> leading to the same generated method name: `USERS__USERS_SERVICE_ID_FKEY`
>>
>> This duplication triggers the following warning during `generateJooq`:
>>
>> > Ambiguous key name: The database object 
>> `schema_a.users_service_id_fkey` generates an inbound key method name 
>> `users`, which conflicts with the previously generated outbound key method 
>> name. Use a custom generator strategy to disambiguate the types. More 
>> information here:
>>
>> To resolve this, I’d like to use `codegen-matcherstrategy` to 
>> automatically include the schema name for foreign key method names in all 
>> schemas except `main`. I reviewed the documentation at [
>> https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/](https://www.jooq.org/doc/latest/manual/code-generation/codegen-matcherstrategy/)
>>  
>> but need guidance on implementing this.
>>
>> Here’s my current configuration setup:
>>
>> ```groovy
>> strategy {
>>     name = 'org.jooq.codegen.DefaultGeneratorStrategy'
>>     matchers {
>>         foreignKeys {
>>             foreignKey {
>>                 // HELP WANTED ...
>>             }
>>         }
>>     }
>> }
>> ```
>>
>> Any help in customizing this configuration so that non-`main` schemas 
>> append the schema name to foreign key method names would be greatly 
>> appreciated. 
>>
>> Thank you! 
>>
>> -- 
>> 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+...@googlegroups.com.
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/jooq-user/9ce75264-3b92-47aa-b227-cdda768b7a2an%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jooq-user/9ce75264-3b92-47aa-b227-cdda768b7a2an%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 visit 
https://groups.google.com/d/msgid/jooq-user/f1f5760c-6ace-4866-aa5a-bd877c5429c8n%40googlegroups.com.

Reply via email to