I need no update Values when update Crypto, but delete all child Values when delete Crypto:
class Crypto {
...
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name="cryptoId", updatable=false)
private Set<Values> values;
...
}
class Values {
...
@ManyToOne
@JoinColumn(name = "cryptoId")
private Crypto crypto;
...
}
SQL debug when I delete Crypto:
Hibernate: delete from "Crypto" where "id"=?
Error:
java.sql.SQLIntegrityConstraintViolationException: ORA-02292: integrity constraint (ARTIKUA.FK_8R5C0WLWJ3LIJTVJ559EV8NAT) violated - child record found
DB is Oracle Why Hibernate, before delete "Crypto", don't delete all their child "Values" values?