public static <F extends EntityInterface> DaoFunction<F, Void> deleteDetachedFunction() {
return new DaoFunction<F, Void>() {
@Override
protected Void doInTransaction(
EntityManager entityManager, F argument) {
EntityInterface result = entityManager.find(
argument.getClass(), argument.getId());
entityManager.remove(result);
return null;
}
};