Hi all, 

I have this PostgreSQL table:

               Table "public.persoon"
       Column       |       Type        | Modifiers 
--------------------+-------------------+-----------
 code               | character varying | not null
 activiteit_code    | character varying | 
 groep_code         | character varying | 
 afdeling_code      | character varying | 
Indexes:
    "persoon_pkey" PRIMARY KEY, btree (code)
Foreign-key constraints:
    "persoon_activiteit_code_fkey" FOREIGN KEY (activiteit_code, 
afdeling_code) REFERENCES activiteit(code, afdeling_code) ON DELETE CASCADE
    "persoon_afdeling_code_fkey" FOREIGN KEY (afdeling_code) REFERENCES 
afdeling(code) ON DELETE CASCADE
    "persoon_groep_code_fkey" FOREIGN KEY (groep_code, afdeling_code) 
REFERENCES groep(code, afdeling_code) ON DELETE CASCADE

jOOQ picks up the "persoon_activiteit_code_fkey" and 
"persoon_groep_code_fkey" keys just fine, but no code is generated for the 
"persoon_afdeling_code_fkey" foreign key. 

When i drop persoon_activiteit_code_fkey , persoon_afdeling_code_fkey gets 
picked up. For some reason, dropping persoon_groep_code_fkey does not have 
the same effect. 

If i rename persoon_afdeling_code_fkey to persoon_aafdeling_code_fkey (to 
make it the first one in alphabetical order), all three foreign keys are 
generated. 

I get the impression that jOOQ currently assumes that every column can have 
just one foreign key. If there's more than one FK per column, only the 
first one it finds is generated and the others ignored (unless they're 
multi-column and picked up for another column). 

Is this indeed the case and is there anything that can be done about this? 

thanks

Sander

Reply via email to