I am getting a foreign key constraint generated even though the relationship annotation is marked "optional":
Code:
@OneToOne(targetEntity = FooImpl.class, optional = true)
@JoinColumn(name = "revision_id", referencedColumnName = "id", nullable = true)
private Foo revision;
when I generate the schema I get:
Code:
alter table k_foo_version
add constraint FK3F88B03D3A287CF1
foreign key (revision_id)
references k_foo;
Which, of course, means I must supply a revision_id for table k_foo even though the column is nullable and the annotation says "optional".