LDAP-333: Support Spring Data Gosling

This commit is contained in:
Rob Winch
2015-07-13 10:23:19 -05:00
parent 5e56f09402
commit 9b51cf44d0

View File

@@ -19,6 +19,7 @@ package org.springframework.ldap.repository.support;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.data.repository.core.EntityInformation;
import org.springframework.data.repository.core.NamedQueries;
import org.springframework.data.repository.core.RepositoryInformation;
import org.springframework.data.repository.core.RepositoryMetadata;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import org.springframework.data.repository.query.QueryLookupStrategy;
@@ -50,7 +51,6 @@ public class LdapRepositoryFactory extends RepositoryFactorySupport {
return null;
}
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
protected Object getTargetRepository(RepositoryMetadata metadata) {
if(!isQueryDslRepository(metadata.getRepositoryInterface())) {
@@ -67,6 +67,10 @@ public class LdapRepositoryFactory extends RepositoryFactorySupport {
}
protected Object getTargetRepository(RepositoryInformation metadata) {
return getTargetRepository((RepositoryMetadata) metadata);
}
private static boolean isQueryDslRepository(Class<?> repositoryInterface) {
return QUERY_DSL_PRESENT && QueryDslPredicateExecutor.class.isAssignableFrom(repositoryInterface);
}