JPA: question about merging an entity before removing it

前端 未结 3 683
春和景丽
春和景丽 2021-02-08 07:33

I know I have to merge the entity before removing it, but I never thought I have to do it inside EJB. First I have these:

e = (Event) scholarBean.merge(e);
schol         


        
3条回答
  •  心在旅途
    2021-02-08 07:53

    ...and you can even combine those:

    Like so:

        public void deleteManCheck(ManCheck manCheck) {
        em.remove(em.merge(manCheck));
    }
    

提交回复
热议问题