java违反了唯一约束_Caused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件...

只有这句clientuser.addCustomer(customer);和这两句clientuser.addCustomer(customer);

clientuser.addAccount(acc);一起出现的错误如下:

Exception in thread "main" org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update;

nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

at springexample.hibernate.TestClient.main(TestClient.java:39)

Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

Caused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (UNISPOWER.SYS_C0011001)

不是唯一约束的问题,应该是相关属性外键关联的空置问题……

未知????

只有这句clientuser.addAccount(acc);的错误:

Exception in thread "main" org.springframework.dao.DataIntegrityViolationException:

not-null property references a null or transient value: springexample.hibernate.Account.customer;

nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value:

springexample.hibernate.Account.customer

at springexample.hibernate.TestClient.main(TestClient.java:40)

Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value:

springexample.hibernate.Account.customer

根据后面语句执行推断,上面的错误,问题可能在于,程序获得RMI服务bean的时候,set过的数据已经存到表中,

再执行addXX方法肯定就不合唯一约束了。

注意getHibernateTemplate().find()的用法,格式不对害死人啊!写了一个格式不太对的查询,

貌似程序现在还处于死循环状态……等待中ing

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值