org.hibernate.NonUniqueObjectException

今天在用Hibernate作修改的时候, 遇到 org.hibernate.NonUniqueObjectException异常,

a different object with the same identifier value was already associated with the session

主要是先查询出了一个实体类例如CountryEntity,而后从新new了一个CountryEntity,修改了其它的属性,可是仍是具备相同的oid,update这个new出来的CountryEntity的时候报错,后面就在原来的CountryEntity上操做的 session

相关文章
相关标签/搜索