It works if I set:
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
instead of
<property name="hibernate.hbm2ddl.auto" value="update" />
It seems Hibernate only creates constaints if the whole database is created and not when it creates the table! Confusing. related