One to many cascade All is not setting parent id while child entry insertion
I am using Hibernate 3 annotations. I have a table 'product' and child table 'product_spec' with one-to-many relation. When i do hibernateTemplate.save(product) it is giving error could not insert: [com.xx.ProductSpec]; SQL [insert into Products_spec Column 'PRODUCT_ID' cannot be null @Entity @Table(name = "product") public class Product implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue @Column(name = "PRODUCT_ID") private Integer productId; @Column(name = "PRODUCT_NAME") private String productName; @OneToMany(mappedBy = "product",fetch = FetchType