the example:
@Entity
public abstract class FpAbstractUser extends AbstractFootprintEntity {
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<FpCertificate> certificate;
}
@Entity
public class FpCertificate extends AbstractFootprintEntity {
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "user_id")
private FpAbstractUser user;
}
---------- queries:
1) DELETE FROM FPCERTIFICATE WHERE ((ID = 18) AND (VERSION = 1))
ok, it works fine......
2) DELETE FROM FPABSTRACTUSER WHERE ((ID = 2) AND (VERSION = 1))
DatabaseException:
java.sql.SQLIntegrityConstraintViolationException: DELETE on table
FPABSTRACTUSER' caused a violation of foreign key constraint
'PARTICIPATIONSERID' for key (2).
The statement has been rolled back.
what should I change in order to delete an user and have all his
certificates deleted as well ?