List of usage examples for javax.persistence EntityManager contains
public boolean contains(Object entity);
From source file:io.apiman.manager.api.jpa.JpaStorage.java
private <T> void remove(T entity) throws StorageException { EntityManager em = getActiveEntityManager(); em.remove(em.contains(entity) ? entity : em.merge(entity)); }