假性删除,不知道那里错了要怎么改

HTTP状态 500 - 内部服务器错误
类型 异常报告

消息 Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:

描述 服务器遇到一个意外的情况,阻止它完成请求。

例外情况

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:

Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id))

The error may exist in file [D:\Homework\JavaEE--何庆新\submit homework\qimo选课\out\artifacts\aaaa_war_exploded\WEB-INF\classes\com\mybatisdao\ClazzMapper.xml]

The error may involve com.mybatisdao.ClazzMapper.clazzDel-Inline

The error occurred while setting parameters

SQL: delete from clazz where id = ?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id))

; Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id))
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

delete from clazz where id = ?
这个表应该是有外键
外键约束失败(javaee.student,CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id))