我在JPA上使用合并时无法编辑记录
@Override
public void merge(int id , String nom) {
EntityTransaction et = em.getTransaction();
et.begin();
Grade grade= em.find(Grade.class,id);
Grade gr=new Grade();
gr.setNumGrd(grade.getNumGrd());
gr.setNomGrd(nom);
em.merge(gr);
et.commit();
}