DATAJPA-111 - Removed unnecessary em.clear() from mass delete methods.

This commit is contained in:
Oliver Gierke
2011-10-12 11:36:33 +02:00
parent a25b3a331e
commit f482b0a51a
2 changed files with 3 additions and 7 deletions

View File

@@ -159,7 +159,6 @@ public class SimpleJpaRepository<T, ID extends Serializable> implements JpaRepos
applyAndBind(getQueryString(DELETE_ALL_QUERY_STRING, entityInformation.getEntityName()), entities, em)
.executeUpdate();
em.clear();
}
/*
@@ -171,7 +170,6 @@ public class SimpleJpaRepository<T, ID extends Serializable> implements JpaRepos
public void deleteAll() {
em.createQuery(getDeleteAllQueryString()).executeUpdate();
em.clear();
}
/*

View File

@@ -181,16 +181,14 @@ public class UserRepositoryTests {
assertNull(repository.findOne(firstUser.getId()));
}
/**
* Tests deleting a user.
*/
@Test
public void testDelete() {
flushTestUsers();
repository.delete(firstUser);
assertNull(repository.findOne(id));
assertThat(repository.exists(id), is(false));
assertThat(repository.findOne(id), is(nullValue()));
}
@Test
@@ -327,7 +325,7 @@ public class UserRepositoryTests {
repository.deleteAll();
assertEquals(0L, repository.count());
assertThat(repository.count(), is(0L));
}
/**