CascadeType « Cascade « JPA Q&A





1. Many-To-One cascade=CascadeType.ALL not working    forum.hibernate.org

Hello, I have many-to-one relation, where A can have many B entities, and B can have only one A. I define annotation in A like: @OneToMany(targetEntity=B.class, fetch=FetchType.LAZY, mappedBy="blah", cascade=CascadeType.ALL) @Column(name="someID", nullable=false) // inverse=true private Set childs = new HashSet(); In B i have something like this: @ManyToOne(targetEntity=A.class, fetch=FetchType.LAZY) @JoinColumn(name="someID", referencedColumnName="...", nullable=false) private A a; When i add new B entities in ...