Delete with Cascade

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">           […]

Share this article on