无法将 NULL 值插入列 'log_id',表 'mloa.dbo.tb_log';该列不允许空值。INSERT 失败

在尝试使用ibatis和hibernate插入数据到TB_LOG表时,遇到了DataIntegrityViolationException,原因是试图将NULL值插入到不允许为空的'log_id'列。检查了Log_SqlMap.xml的参数映射和hibernate的配置,问题仍未解决。通过查询分析器手动执行INSERT语句同样失败。最后发现解决方案在于修改数据库表结构,将'log_id'列设置为标识并设置适当的标识种子和递增量。
摘要由CSDN通过智能技术生成

 调用ibatis的DAO:
2008-9-23 15:43:09 org.apache.catalina.core.ApplicationContext log
信息: org.springframework.dao.DataIntegrityViolationException: SqlMapClient operation; SQL [];  
--- The error occurred in com/miracle/dm/sysmgr/log/sqlmapxml/Log_SqlMap.xml. 
--- The error occurred while applying a parameter map. 
--- Check the insertLog-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: 无法将 NULL 值插入列 'log_id',表 'mloa.dbo.tb_log';该列不允许空值。INSERT 失败。; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/miracle/dm/sysmgr/log/sqlmapxml/Log_SqlMap.xml. 
--- The error occurred while applying a parameter map. 
--- Check the insertLog-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: 无法将 NULL 值插入列 'log_id',表 'mloa.dbo.tb_log'ÿ

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值