个人案例:
异常:
{success=false, errMsg=addShop error:
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'owner_id' cannot be null
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: INSERT INTO tb_shop(owner_id , area_id , shop_category_id , shop_name , shop_desc , shop_addr , phone , shop_img , priority , create_time , last_edit_time , enable_status , advice ) VALUES (?,?,?,? ,?,?,?,?,?, ?,?,?,? )
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'owner_id' cannot be null
; SQL []; Column 'owner_id' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'owner_id' cannot be null}
分析解决
实际情况为数据库有onwer_id值 前端尚未设置通过session获取
在目前开发阶段 仍然为手动设置 只是设置的时候 误删了设置owner_id 这个命令 导致 每次提交无owner_id信息 显示错误