Documenting this here because I just wasted an hour trying to figure this out.
I have an entity Foo with:
@ManyToOne(optional = false)
@JoinColumn(name = "barId")
private Bar bar;
Why does Hibernate not create a foreign key constraint on foo.bar -> bar.id ?