Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails 无法删除GORM中的用户_Grails_Spring Security_Gorm - Fatal编程技术网

Grails 无法删除GORM中的用户

Grails 无法删除GORM中的用户,grails,spring-security,gorm,Grails,Spring Security,Gorm,当我试图删除GORM中的受访者时,出现以下错误: Referential integrity constraint violation: "FK_APCC8LXK2XNUG8377FATVBN04: PUBLIC.USER_ROLE FOREIGN KEY(USER_ID) REFERENCES PUBLIC.USERS(ID) (40)"; SQL statement: delete from users where id=? and version=? [23503-176] 这是我的

当我试图删除GORM中的受访者时,出现以下错误:

Referential integrity constraint violation: "FK_APCC8LXK2XNUG8377FATVBN04: 
PUBLIC.USER_ROLE FOREIGN KEY(USER_ID) REFERENCES PUBLIC.USERS(ID) (40)"; 
SQL statement: delete from users where id=? and version=? [23503-176]
这是我的领域:

package com.cgi.recruitmenttest

import com.cgi.security.User

class Interviewee extends User{

String firstName
String lastName
String email
String telephone
String level
static hasMany = [results:Result,tests:TestInterviewe]

static constraints = {
    lastName()
    firstName()
    email(email: true)
    telephone(nullable: true)
    level inList: ['Debutant', 'Confirme', 'Expert']
}
}

我只是尝试创建一个没有结果和测试的受访者,但是当我删除时,我会得到这个错误


有人能帮忙吗?谢谢

您想从
用户
表中删除数据,但在
用户角色
表中,它包含
用户
表的外键(命名用户ID)。这就是您无法删除的原因。首先根据
用户
表ID删除
用户角色
表的数据,然后您可以删除。

如何删除?我使用默认方法删除