could not execute statement; SQL [n/a]; constraint [null]级联删除异常

在用ssh做删除客户的同时删除联系人的时候会遇见这种异常:

HTTP Status 500 - could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

这是因为配置的时候没有在hbm.xml中写cascade=“delete"。正确写法: