On Wednesday, 5 September 2012 13:08:49 UTC+1, Ben Hood wrote:
>
> So I've managed to reproduce the issue and also have convinced logback to 
> append the JOOQ codegen to it's own file, which I have attached. At the top 
> of the log you will see a bunch of Hibernate stuff (which we still use in 
> our DDL generator, since we haven't gotten around to porting this away 
> yet), which is fairly harmless. In the middle of the file you see the root 
> cause, which is due to a bug in HSQL (it seems to be down to some FK 
> definitions I have just added, because commenting these out seems to solve 
> the HSQL problem, but obviously this has nothing to do with JOOQ). Then you 
> see the JOOQ codegen.
>

So I've tracked the root cause down:

HSQL was failing partially (silently) when I tried to add an two-column FK 
where there was no unique constraint for the two referenced columns in the 
parent table. The statement:

alter table A add constraint fk_a_b foreign key (FOO, BAR) references B

fails silently if there is no unique constraint on B.FOO and B.BAR. 
Qualifying the FK include the parent columns actually causes HSQL to fail:

alter table A add constraint fk_a_b foreign key (FOO, BAR) references 
B (FOO, BAR)

with

a UNIQUE constraint does not exist on referenced columns: B


So sorry to spam the list with what is fundamentally an HSQL issue, but the 
resultant JOOQ codegen did make me wonder.

Cheers,

Ben

Reply via email to