Persistence Exception foreign key contraint fails in hibernate

Advertisements I have defined the following two classes in hibernate @Entity public class Person { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String name; } @Entity public class PhoneNumber { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @ManyToOne(cascade = CascadeType.ALL) private Person person; } When I persist a phone number object or a person… Read More Persistence Exception foreign key contraint fails in hibernate