Java 全部收回和刷新之间的区别

Java 全部收回和刷新之间的区别,java,jpa,entitymanager,Java,Jpa,Entitymanager,全部收回和刷新之间的区别是什么: em.getEntityManagerFactory().getCache().evict(AdminUtilisateur.class, user); 及 我应该什么时候使用每一个 谢谢。退出:在缓存中将实例标记为不再需要 刷新:从数据库中刷新实例的状态,覆盖对实体所做的更改在此处找到anwser您可以解释更多@vvs em.refresh(em.getReference(AdminUtilisateur.class, user.getId()));

全部收回和刷新之间的区别是什么:

em.getEntityManagerFactory().getCache().evict(AdminUtilisateur.class, user);

我应该什么时候使用每一个


谢谢。

退出:在缓存中将实例标记为不再需要


刷新:从数据库中刷新实例的状态,覆盖对实体所做的更改

在此处找到anwser您可以解释更多@vvs
em.refresh(em.getReference(AdminUtilisateur.class, user.getId()));