JBPM “无效数字” 异常 与 Hibernate ID策略

最开始在jBPM4.3执行过程中老是遇到 SQL异常,提示“无效数字”。仔细跟踪发现,是因为Hibernate ID策略与jBPM4.3中的一些Model中字段名称造成的。在Hibernate Reference 中(14.5. Refering to identifier property)有如下描述:

 Note: this has changed significantly starting in version 3.2.2. In previous versions, id always referred to the identifier property no matter what its actual name. A ramification of that decision was that non-identifier properties named id could never be referenced in Hibernate queries.

而在jBPM4.3jbpm.execution.hbm.xmlExecutionImpl 类有如下配置:

<class name="ExecutionImpl"

         table="JBPM4_EXECUTION"

         discriminator-value="pvm">

    <id name="dbid" column="DBID_">

      <generator class="assigned" />

</id>

……

<property name="id" column="ID_" unique="true" />

检查发现,项目中使用的Hibernate版本是3.2.0。这就是导致错误的原因了,在ExecutionImpl类中对id访问的时候,始终都是访问的DBID_列。解决方式是将hibernate换成3.2.2以上的版本即可。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值