DATAJPA-83 - Added getOne(ID id) to JpaRepository.
Added a getOne(ID id) method to both JpaRepository as well as SimpleJpaRepository to be able to obtain references to entities (as implemented by EntityManager.getReference(…)).
This commit is contained in:
@@ -1093,6 +1093,18 @@ public class UserRepositoryTests {
|
||||
assertThat(lastname, hasItem("Dave"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAJPA-83
|
||||
*/
|
||||
@Test
|
||||
public void looksUpEntityReference() {
|
||||
|
||||
flushTestUsers();
|
||||
|
||||
User result = repository.getOne(firstUser.getId());
|
||||
assertThat(result, is(firstUser));
|
||||
}
|
||||
|
||||
private Page<User> executeSpecWithSort(Sort sort) {
|
||||
|
||||
flushTestUsers();
|
||||
|
||||
Reference in New Issue
Block a user