DATAJPA-111 - Removed unnecessary em.clear() from mass delete methods.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user