【发布时间】:2011-04-01 10:35:38
【问题描述】:
// lookup existing user & set a currently null child entity (ContactInfo)
user.setContactInfo(contactInfo);
// update the user in the datastore with newly created child Entity
entityManager.persist(user);
产生异常:
javax.persistence.EntityExistsException: User@b3089 is already persistent
由于用户已经存在,除了entityManager.persist 之外,我应该使用其他方法进行更新而不是插入吗?
【问题讨论】:
标签: java spring orm jpa persistence