From cc0b38f3da8ac0a79f77de7558d45eacc711f527 Mon Sep 17 00:00:00 2001 From: Pan Li Date: Tue, 18 Dec 2018 19:10:40 -0600 Subject: [PATCH] upgrade spring data commons to 2.1.0.RELEASE, resolve #190. (#191) Signed-off-by: Pan Li --- pom.xml | 4 ++-- .../spring/data/gremlin/mapping/GremlinMappingContext.java | 4 +--- .../repository/support/GremlinRepositoryFactory.java | 6 +++--- .../support/GremlinRepositoryFactoryUnitTest.java | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index ea4b36c1..8297ed89 100644 --- a/pom.xml +++ b/pom.xml @@ -39,8 +39,8 @@ 1.8 UTF-8 - 5.0.1.RELEASE - 2.0.7.RELEASE + 5.1.0.RELEASE + 2.1.0.RELEASE 2.0.4.RELEASE 3.2.4 diff --git a/src/main/java/com/microsoft/spring/data/gremlin/mapping/GremlinMappingContext.java b/src/main/java/com/microsoft/spring/data/gremlin/mapping/GremlinMappingContext.java index 21947d9a..b5b121aa 100644 --- a/src/main/java/com/microsoft/spring/data/gremlin/mapping/GremlinMappingContext.java +++ b/src/main/java/com/microsoft/spring/data/gremlin/mapping/GremlinMappingContext.java @@ -6,15 +6,13 @@ package com.microsoft.spring.data.gremlin.mapping; import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; import org.springframework.data.mapping.context.AbstractMappingContext; import org.springframework.data.mapping.model.Property; import org.springframework.data.mapping.model.SimpleTypeHolder; import org.springframework.data.util.TypeInformation; public class GremlinMappingContext - extends AbstractMappingContext, GremlinPersistentProperty> - implements ApplicationContextAware { + extends AbstractMappingContext, GremlinPersistentProperty> { private ApplicationContext context; @Override diff --git a/src/main/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactory.java b/src/main/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactory.java index c7b4b03c..67391a0d 100644 --- a/src/main/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactory.java +++ b/src/main/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactory.java @@ -15,8 +15,8 @@ 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.EvaluationContextProvider; import org.springframework.data.repository.query.QueryLookupStrategy; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.lang.NonNull; import org.springframework.util.Assert; @@ -53,8 +53,8 @@ public EntityInformation getEntityInformation(Class domainClas } @Override - protected Optional getQueryLookupStrategy(QueryLookupStrategy.Key key, - EvaluationContextProvider provider) { + protected Optional getQueryLookupStrategy( + QueryLookupStrategy.Key key, QueryMethodEvaluationContextProvider provider) { return Optional.of(new GremlinQueryLookupStrategy(this.operations)); } diff --git a/src/test/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactoryUnitTest.java b/src/test/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactoryUnitTest.java index 81feb5aa..1e9dfc74 100644 --- a/src/test/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactoryUnitTest.java +++ b/src/test/java/com/microsoft/spring/data/gremlin/repository/support/GremlinRepositoryFactoryUnitTest.java @@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.data.repository.core.EntityInformation; -import org.springframework.data.repository.query.ExtensionAwareEvaluationContextProvider; import org.springframework.data.repository.query.QueryLookupStrategy; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -52,8 +51,8 @@ public void testGetEntityInformation() { @Test public void testGetQueryLookupStrategy() { - final Optional strategyOptional = this.factory.getQueryLookupStrategy( - QueryLookupStrategy.Key.CREATE, new ExtensionAwareEvaluationContextProvider()); + final Optional strategyOptional = this.factory. + getQueryLookupStrategy(QueryLookupStrategy.Key.CREATE, null); Assert.assertTrue(strategyOptional.isPresent()); }