DATAJPA-593 - Improved detection of custom implementations for CDI repositories.
Adapted to API changes in CDI extension. Related ticket: DATACMNS-565.
This commit is contained in:
committed by
Oliver Gierke
parent
ebb2be942a
commit
9dbb1d1390
@@ -25,6 +25,7 @@ import javax.persistence.EntityManager;
|
||||
|
||||
import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryBean;
|
||||
import org.springframework.data.repository.config.CustomRepositoryImplementationDetector;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -46,12 +47,12 @@ class JpaRepositoryBean<T> extends CdiRepositoryBean<T> {
|
||||
* @param entityManagerBean must not be {@literal null}.
|
||||
* @param qualifiers must not be {@literal null}.
|
||||
* @param repositoryType must not be {@literal null}.
|
||||
* @param customImplementationBean can be {@literal null}.
|
||||
* @param detector can be {@literal null}.
|
||||
*/
|
||||
JpaRepositoryBean(BeanManager beanManager, Bean<EntityManager> entityManagerBean, Set<Annotation> qualifiers,
|
||||
Class<T> repositoryType, Bean<?> customImplementationBean) {
|
||||
Class<T> repositoryType, CustomRepositoryImplementationDetector detector) {
|
||||
|
||||
super(qualifiers, repositoryType, beanManager, customImplementationBean);
|
||||
super(qualifiers, repositoryType, beanManager, detector);
|
||||
|
||||
Assert.notNull(entityManagerBean);
|
||||
this.entityManagerBean = entityManagerBean;
|
||||
|
||||
@@ -119,10 +119,8 @@ public class JpaRepositoryExtension extends CdiRepositoryExtensionSupport {
|
||||
EntityManager.class.getName(), qualifiers));
|
||||
}
|
||||
|
||||
Bean<?> customImplementationBean = getCustomImplementationBean(repositoryType, beanManager, qualifiers);
|
||||
|
||||
// Construct and return the repository bean.
|
||||
return new JpaRepositoryBean<T>(beanManager, entityManagerBean, qualifiers, repositoryType,
|
||||
customImplementationBean);
|
||||
getCustomImplementationDetector());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user