diff --git a/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlQueryCreatorUtils.java b/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlQueryCreatorUtils.java index 6d751b93..fe3249eb 100644 --- a/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlQueryCreatorUtils.java +++ b/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlQueryCreatorUtils.java @@ -21,15 +21,16 @@ import static com.couchbase.client.java.query.dsl.Expression.*; import java.util.Collection; import java.util.Iterator; +import org.springframework.data.couchbase.core.convert.CouchbaseConverter; +import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty; +import org.springframework.data.couchbase.repository.query.ConvertingIterator; +import org.springframework.data.mapping.PersistentPropertyPath; +import org.springframework.data.repository.query.parser.Part; + import com.couchbase.client.java.document.json.JsonArray; import com.couchbase.client.java.query.dsl.Expression; import com.couchbase.client.java.query.dsl.functions.PatternMatchingFunctions; import com.couchbase.client.java.query.dsl.functions.StringFunctions; -import org.springframework.data.couchbase.core.convert.CouchbaseConverter; -import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty; -import org.springframework.data.couchbase.repository.query.ConvertingIterator; -import org.springframework.data.mapping.context.PersistentPropertyPath; -import org.springframework.data.repository.query.parser.Part; /** * Utils for creating part tree expressions diff --git a/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlUtils.java b/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlUtils.java index 7bc10fee..78e733e3 100644 --- a/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlUtils.java +++ b/src/main/java/org/springframework/data/couchbase/repository/query/support/N1qlUtils.java @@ -16,19 +16,27 @@ package org.springframework.data.couchbase.repository.query.support; -import static com.couchbase.client.java.query.Select.select; -import static com.couchbase.client.java.query.dsl.Expression.i; -import static com.couchbase.client.java.query.dsl.Expression.path; -import static com.couchbase.client.java.query.dsl.Expression.s; -import static com.couchbase.client.java.query.dsl.Expression.x; -import static com.couchbase.client.java.query.dsl.functions.AggregateFunctions.count; -import static com.couchbase.client.java.query.dsl.functions.MetaFunctions.meta; -import static com.couchbase.client.java.query.dsl.functions.StringFunctions.lower; +import static com.couchbase.client.java.query.Select.*; +import static com.couchbase.client.java.query.dsl.Expression.*; +import static com.couchbase.client.java.query.dsl.functions.AggregateFunctions.*; +import static com.couchbase.client.java.query.dsl.functions.MetaFunctions.*; +import static com.couchbase.client.java.query.dsl.functions.StringFunctions.*; import static org.springframework.data.couchbase.core.support.TemplateUtils.*; import java.util.ArrayList; import java.util.List; -import java.util.regex.Pattern; + +import org.springframework.core.convert.converter.Converter; +import org.springframework.data.couchbase.core.convert.CouchbaseConverter; +import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity; +import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty; +import org.springframework.data.couchbase.repository.query.CouchbaseEntityInformation; +import org.springframework.data.couchbase.repository.query.CountFragment; +import org.springframework.data.domain.Sort; +import org.springframework.data.mapping.PersistentPropertyPath; +import org.springframework.data.mapping.PropertyPath; +import org.springframework.data.repository.core.EntityMetadata; +import org.springframework.data.repository.query.ReturnedType; import com.couchbase.client.java.document.json.JsonArray; import com.couchbase.client.java.document.json.JsonObject; @@ -42,22 +50,6 @@ import com.couchbase.client.java.query.dsl.functions.TypeFunctions; import com.couchbase.client.java.query.dsl.path.FromPath; import com.couchbase.client.java.query.dsl.path.WherePath; import com.couchbase.client.java.repository.annotation.Field; -import org.springframework.core.convert.converter.Converter; -import org.springframework.data.couchbase.core.CouchbaseOperations; -import org.springframework.data.couchbase.core.convert.CouchbaseConverter; -import org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity; -import org.springframework.data.couchbase.core.mapping.CouchbasePersistentProperty; -import org.springframework.data.couchbase.repository.query.CouchbaseEntityInformation; -import org.springframework.data.couchbase.repository.query.CountFragment; -import org.springframework.data.couchbase.repository.query.StringN1qlBasedQuery; -import org.springframework.data.domain.Sort; -import org.springframework.data.mapping.PropertyPath; -import org.springframework.data.mapping.context.PersistentPropertyPath; -import org.springframework.data.repository.core.EntityMetadata; -import org.springframework.data.repository.query.ReturnedType; -import org.springframework.expression.EvaluationContext; -import org.springframework.expression.common.TemplateParserContext; -import org.springframework.expression.spel.standard.SpelExpressionParser; /** * Utility class to deal with constructing well formed N1QL queries around Spring Data entities, so that diff --git a/src/test/java/org/springframework/data/couchbase/repository/query/PartTreeN1qBasedQueryTest.java b/src/test/java/org/springframework/data/couchbase/repository/query/PartTreeN1qBasedQueryTest.java index 8979ba12..5d5a45b1 100644 --- a/src/test/java/org/springframework/data/couchbase/repository/query/PartTreeN1qBasedQueryTest.java +++ b/src/test/java/org/springframework/data/couchbase/repository/query/PartTreeN1qBasedQueryTest.java @@ -40,9 +40,9 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.mapping.PersistentPropertyPath; import org.springframework.data.mapping.PropertyPath; import org.springframework.data.mapping.context.MappingContext; -import org.springframework.data.mapping.context.PersistentPropertyPath; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.CrudRepository;