The highlighted line defines “cascade=Cascade Type.ALL” and it essentially means that any change that happens to Employee Entity must cascade to all associated entities (Accounts Entity in this case) also. This means that if you save an employee into the database, then all associated accounts will also be saved into the database. If an Employee is deleted, then all accounts associated with that Employee will also be deleted. But if we want to cascade only the save operation but not the delete operation, we need to clearly specify it using below code.  @OneToMany(cascade=CascadeType.PERSIST, fetch = FetchType.LAZY)
@JoinColumn(name="EMPLOYEE_ID")
private Set accounts; Now only when the save() or persist() methods are called using employee instance, will the accounts be persisted.If any other method is called on session, its effect will not affect/cascade to the accounts entity.