JPA thinks I'm deleting a detached object

前端 未结 7 2192
萌比男神i
萌比男神i 2020-12-14 00:30

I\'ve got a DAO that I used to load and save my domain objects using JPA. I finally managed to get the transaction stuff working, now I\'ve got another issue.

In my

7条回答
  •  感情败类
    2020-12-14 00:54

    Get the instance by using em.getReference() instead of em.find().

    For instance, try:

    em.remove(em.getReference(INTFC.class, id)); 
    

提交回复
热议问题