public class MockEntityFinder extends Object implements EntityFinder
| Constructor and Description |
|---|
MockEntityFinder() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRepository(org.springframework.data.repository.CrudRepository<? extends org.springframework.data.domain.Persistable,Long> repository,
Class<?> entityClass) |
<T> T |
find(Long id,
Class<T> entityClass)
Returns the entity on the basis of the entity class and its ID.
|
<T> T |
findAndDetach(Long id,
Class<T> entityClass)
Returns the entity on the basis of the entity class and its ID bypassing the
Hibernate cache
|
public <T> T find(Long id, Class<T> entityClass) throws javax.persistence.EntityNotFoundException
EntityFinderfind in interface EntityFinderid - the ID of the entityentityClass - the class of the entityjavax.persistence.EntityNotFoundException - if the repository or the entity
could not be foundpublic <T> T findAndDetach(Long id, Class<T> entityClass) throws javax.persistence.EntityNotFoundException
EntityFinderfindAndDetach in interface EntityFinderid - the ID of the entityentityClass - the class of the entityjavax.persistence.EntityNotFoundException - if the repository or the entity
could not be foundCopyright © 2015–2020 42 BV. All rights reserved.