【发布时间】:2010-10-18 19:59:19
【问题描述】:
我有一个抛出以下异常的 grails 项目:
org.springframework.dao.DataIntegrityViolationException: could not delete: [Role#4]; SQL [delete from role where id=? an
d version=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not del
ete: [Role#4]
在我的角色域中,我为创建此错误所做的只是更改其中一个变量的定义
List<RoleTool> roleTools = new ArrayList<RoleTool>()
到
ArrayList<RoleTool> roleTools = new ArrayList<RoleTool>()
为什么会这样?
【问题讨论】:
-
查看你的数据库,看看 Role#4 有什么值