报错 org.springframework.dao.DataIntegrityViolationException: Error attempting to get column


错误

dao.DataIntegrityViolationException: Error attempting to get column 'owner_name' from result set.  Cause: java.sql.SQLDataException: Cannot determine value type from string '大老板'

原因:

  • 数据库字段与实体类字段类型不匹配
  • 如果代码中使用了union,union中的每个sql字段必须一一对应,当对应的数据类型有误时则会报上述异常