Delete with Cascade
- 7th Mar 2017
- 0
- 5797
- Delete with cascade in hibernate delete with cascade operation in hibernate delete without cascade in hibernate hibernate delete cascade How delete with cascade works in hibernate
Let’s perform Delete operation with and without cascade to understand it better Delete with Cascade Annotation configuration Applicant.java @OneToMany(mappedBy="applicant") @Cascade(CascadeType.DELETE) private Set<Address> addresses; @OneToMany(mappedBy=”applicant”) @Cascade(CascadeType.DELETE) private Set<Address> addresses; XML configuration applicant.hbm.xml <set name="addresses" table="Address" inverse="true" lazy="true" fetch="select" cascade="delete"> […]