更新用户是报错

来源:8-3 新增用户接口开发-2

weixin_慕标4370201

2020-07-11

更新用户时报错

Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘operator’ cannot be null

The error may involve com.cole.dao.SysUserMapper.updateByPrimaryKey-Inline

The error occurred while setting parameters

SQL: update sys_user set username = ?, telephone = ?, mail = ?, password = ?, dept_id = ?, status = ?, remark = ?, operator = ?, operate_time = ?, operate_ip = ? where id = ?

Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘operator’ cannot be null

; SQL []; Column ‘operator’ cannot be null; nested exception is java.sql.SQLIntegrityConstraintViolationException: Column ‘operator’ cannot be null

写回答

1回答

Jimin

2020-07-12

你好,你可以把更新的operator这个字段赋值一个值,比如当前登录的用户名,也可以将数据库里该字段设置为允许为null,就可以了

0
1
weixin_慕标4370201
非常感谢!我将三个关于operator的值设置为NOT NULL就可以了
2020-07-12
共1条回复

Java开发企业级权限管理系统

源于企业真实Java项目,涉及大量高级技巧,覆盖权限管理开发技术

2261 学习 · 1347 问题

查看课程