How do I properly cascade save a one-to-one, bidirectional relationship on primary key in Hibernate 3.6
I have an one-to-one, bidirectional entity relationship with shared keys. When I attempt to save the owner of the association I get a "null id generated" exception against the owned side of the relationship. I am utilizing hibernate-entitymanager and using spring for transaction management. Owning Entity @Entity @Table(name = "lead") public class Lead { private Long leadId; private LeadAffiliate leadAffiliate; @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long getLeadId() { return leadId; } @OneToOne(cascade = CascadeType.ALL) @PrimaryKeyJoinColumn public LeadAffiliate