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