第一次遇到
异常日志:
org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'deleted' from result set. Cause: java.sql.SQLDataException: Cannot determine value type from string '1,2,5'
; Cannot determine value type from string '1,2,5'; nested exception is java.sql.SQLDataException: Cannot determine value type from string '1,2,5'
DataIntegrityViolationException : 数据完整性 违背 异常 (违反了数据完整性)
原因:
看了下xml的SQL,漏写了
第二次遇到:
异常日志:
org.springframework.dao.DataIntegrityViolationException:
### Error querying database. Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'user_id' in where clause is ambiguous
原因:
多表关联时,两个表都有user_id,但是你把user_id作为条件的时候没有指定哪个表的user_id
修改 xxx表.user_id 即可
总结这个错误:都是SQL的问题,多检查