我该如何解决这个问题?我不明白这个错误!
例外:
Caused by: javax.persistence.RollbackException: Exception [EclipseLink-7197] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Null or zero primary key encountered in unit of work clone [Entities.Employe[ matEmp=0 ]], primary key [0].
这是我的代码:
EntityTransaction et = em.getTransaction();
et.begin();
Employe e = em.find(Employe.class,mat);
e.setNp(np);
em.merge(e);