operation « DAO « JPA Q&A





1. JPA and DAO implementation of delete operation    stackoverflow.com

I'd like to know which implementation of the remove method is better:

public void remove(T t) {
   entityManager.remove(entityManager.merge(t));
}

public void remove(PK pk) {
   entityManager.remove(entityManager.getReference(entityType, pk));
}
I've read quite a lot ...