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