java - 数据完整性违规异常 : could not insert

标签 java spring hibernate

也许有人可以帮忙,我该如何解决这个问题? 我正在使用 hibernate、spring 和 gwt。

com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract void
com.yeah.client.service.PictureService.saveItem(com.yeah.shared.model.Picture)' threw an unexpected exception: org.springframework.dao.DataIntegrityViolationException: could not insert: [com.yeah.shared.model.Picture]; SQL [insert into YeaH.Picture (albumID, picLocation) values (?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert:
[com.yeah.shared.model.Picture]

最佳答案

看来您正在插入无法验证约束的对象。 (可能使用相同的 key )

关于java - 数据完整性违规异常 : could not insert,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6097037/

相关文章:

java - Grails 域类从哪里获取它们的查询方法?

spring - 为具有 2 个不同登录门户的同一应用程序在同一浏览器上维护不同的 session ID

hibernate - 命令对象中的 Grails 域对象始终保存

java - 使 UTF-8 可用于使用 Spring 将阿拉伯语数据放入 Mysql DB

mysql - 将用户的数组列表存储到mysql中

Java解密加密兼容SJCL?

java - 使用我的 JFrame 同时播放音乐

java - 何时使用 .jar 与 .exe?

java - 通过注释类加载应用程序上下文

eclipse - 更新sts或安装扩展时出现问题