Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
what does this exception mean?
org.hibernate.util.JDBCExceptionReporter:78 : logExceptions() : Duplicate entry '0' for key 1
最肯定的是,您没有用对应的auto-increment值标记一个字段。
auto-increment
这样,当您尝试创建一个 newINSERT时,它会尝试使用integer类型字段的默认值(即0 )保存它。但是你已经有一个值为“0”的项目,所以它给了你例外。
INSERT
integer
如果您使用自动增量标记该字段,它将采用最后保存的entry value + 1.
entry value + 1