DATAJPA-81 - SimpleJpaRepository.exists(…) now projects to the id to prevent the entire object being read and mapped.

This commit is contained in:
Oliver Gierke
2011-09-05 08:31:32 +02:00
parent 04349d25dc
commit ca52ec29be
3 changed files with 15 additions and 11 deletions

View File

@@ -59,6 +59,7 @@ public class JpaRepositoryTests {
SampleEntity entity = new SampleEntity("foo", "bar");
repository.saveAndFlush(entity);
assertThat(repository.exists(new SampleEntityPK("foo", "bar")), is(true));
assertThat(repository.count(), is(1L));
assertThat(repository.findOne(new SampleEntityPK("foo", "bar")), is(entity));