Skip to content

Commit

Permalink
Adopt to deprecation removals in Commons.
Browse files Browse the repository at this point in the history
Closes #519
  • Loading branch information
mp911de committed Nov 19, 2024
1 parent a1e3eab commit d3d2024
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider;
import org.springframework.data.repository.query.RepositoryQuery;
import org.springframework.data.repository.query.ValueExpressionDelegate;
import org.springframework.lang.Nullable;
import org.springframework.ldap.core.LdapOperations;
import org.springframework.util.Assert;

Expand Down Expand Up @@ -146,15 +144,15 @@ protected Object getTargetRepository(RepositoryInformation information) {
ldapOperations.getObjectDirectoryMapper(), information.getDomainType());
}

return getTargetRepositoryViaReflection(information, ldapOperations,
ldapOperations.getObjectDirectoryMapper(),
return getTargetRepositoryViaReflection(information, ldapOperations, ldapOperations.getObjectDirectoryMapper(),
information.getDomainType());
}

@Override
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(Key key,
ValueExpressionDelegate valueExpressionDelegate) {
return Optional.of(new LdapQueryLookupStrategy(ldapOperations, instantiators, mappingContext, valueExpressionDelegate));
return Optional
.of(new LdapQueryLookupStrategy(ldapOperations, instantiators, mappingContext, valueExpressionDelegate));
}

/**
Expand Down Expand Up @@ -183,8 +181,8 @@ private static boolean acceptsMappingContext(RepositoryInformation information)
return acceptsMappingContext;
}

private record LdapQueryLookupStrategy(LdapOperations ldapOperations,
EntityInstantiators instantiators, MappingContext<? extends PersistentEntity<?, ?>, ? extends PersistentProperty<?>> mappingContext,
private record LdapQueryLookupStrategy(LdapOperations ldapOperations, EntityInstantiators instantiators,
MappingContext<? extends PersistentEntity<?, ?>, ? extends PersistentProperty<?>> mappingContext,
ValueExpressionDelegate valueExpressionDelegate) implements QueryLookupStrategy {

@Override
Expand All @@ -195,7 +193,8 @@ public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata,
Class<?> domainType = metadata.getDomainType();

if (queryMethod.hasQueryAnnotation()) {
return new AnnotatedLdapRepositoryQuery(queryMethod, domainType, ldapOperations, mappingContext, instantiators, valueExpressionDelegate);
return new AnnotatedLdapRepositoryQuery(queryMethod, domainType, ldapOperations, mappingContext, instantiators,
valueExpressionDelegate);
} else {
return new PartTreeLdapRepositoryQuery(queryMethod, domainType, ldapOperations, mappingContext, instantiators);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class LdapRepositoryConfigurationExtensionUnitTests {
private BeanDefinitionRegistry registry = new DefaultListableBeanFactory();

private RepositoryConfigurationSource configurationSource = new AnnotationRepositoryConfigurationSource(metadata,
EnableLdapRepositories.class, loader, environment, registry);
EnableLdapRepositories.class, loader, environment, registry, null);

@Test // DATALDAP-60
void isStrictMatchIfDomainTypeIsAnnotatedWithEntry() {
Expand Down

0 comments on commit d3d2024

Please sign in to comment.