I just tried this one thing:
Code:
@OneToMany(mappedBy = "contenusPromo")
@org.hibernate.annotations.Cascade({
org.hibernate.annotations.CascadeType.ALL,
org.hibernate.annotations.CascadeType.DELETE_ORPHAN
})
private List<BlocTextePromo> promotions = new ArrayList<BlocTextePromo>();
But I still get my lovely error:
Code:
org.hibernate.exception.ConstraintViolationException: could not execute update query
Code:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`BLOC_TEXTE`, CONSTRAINT `FK8CDB44D71D9FF2F9` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENUS` (`CONTENT_ID`))