I\'m using Spring with Hibernate as a JPA provider and are trying to get a @OneToMany (a contact having many phonenumbers) to save the foreign key in the phone numbers table
If you want your relationship unidirectional i.e. can navigate from Contact to Phone's only, you need to add
@JoinColumn(name = "contact_id", nullable = false)
Under your @OneToMany on your parent entity.
@OneToMany
nullable = false IS VITAL if you want hibernate to populate the fk on the child table
nullable = false