|
28 | 28 | import org.springframework.data.querydsl.QueryDslPredicateExecutor;
|
29 | 29 | import org.springframework.data.repository.core.EntityInformation;
|
30 | 30 | import org.springframework.data.repository.core.NamedQueries;
|
| 31 | +import org.springframework.data.repository.core.RepositoryInformation; |
31 | 32 | import org.springframework.data.repository.core.RepositoryMetadata;
|
32 | 33 | import org.springframework.data.repository.core.support.PersistentEntityInformation;
|
33 | 34 | import org.springframework.data.repository.core.support.RepositoryFactorySupport;
|
|
38 | 39 | import org.springframework.data.repository.query.RepositoryQuery;
|
39 | 40 | import org.springframework.data.repository.query.parser.AbstractQueryCreator;
|
40 | 41 | import org.springframework.util.Assert;
|
41 |
| -import org.springframework.util.ClassUtils; |
42 | 42 |
|
43 | 43 | /**
|
44 | 44 | * {@link RepositoryFactorySupport} specific of handing
|
@@ -101,16 +101,10 @@ public <T, ID extends Serializable> EntityInformation<T, ID> getEntityInformatio
|
101 | 101 | * @see org.springframework.data.repository.core.support.RepositoryFactorySupport#getTargetRepository(org.springframework.data.repository.core.RepositoryMetadata)
|
102 | 102 | */
|
103 | 103 | @Override
|
104 |
| - @SuppressWarnings({ "unchecked", "rawtypes" }) |
105 |
| - protected Object getTargetRepository(RepositoryMetadata metadata) { |
| 104 | + protected Object getTargetRepository(RepositoryInformation repositoryInformation) { |
106 | 105 |
|
107 |
| - EntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType()); |
108 |
| - |
109 |
| - if (ClassUtils.isAssignable(QueryDslPredicateExecutor.class, metadata.getRepositoryInterface())) { |
110 |
| - return new QuerydslKeyValueRepository(entityInformation, keyValueOperations); |
111 |
| - } |
112 |
| - |
113 |
| - return new SimpleKeyValueRepository(entityInformation, keyValueOperations); |
| 106 | + EntityInformation<?, Serializable> entityInformation = getEntityInformation(repositoryInformation.getDomainType()); |
| 107 | + return super.getTargetRepositoryViaReflection(repositoryInformation, entityInformation, keyValueOperations); |
114 | 108 | }
|
115 | 109 |
|
116 | 110 | /*
|
|
0 commit comments