@ Transactional public void delete ( E entity ) { if ( entityManager . contains ( entity ) ) { entityManager . remove ( entity ) ; } else { // could be a delete on a transient instance E entityRef = entityManager . getReference ( type , entity . getId ( ) ) ; if ( entityRef != null ) { entityManager . remove ( entityRef ) ; } else { log . warning ( "Attempt to delete an instance that is not present in the database: " + entity ) ; } } }
Delete the given entity E from the repository .