From ce59d893ba0581947fbd91880dfac98d20f08552 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Sun, 21 Aug 2011 16:46:11 +0200 Subject: [PATCH] DATACMNS-61 - Adapted changes in Spring Data Commons. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use QueryMethod accessor methods instead of dropped Type enum to determine query execution. Added custom MongoParameters and MongoParameter to allow discovering a Distance parameter for repository queries which will transparently add a 'maxDistance' clause for *Near criterias in query methods. If the given Distance is equipped with a Metric we will rather use $nearSphere over $near. Added asList() to Point class to circumvent bug in BasicBSONObject.equals(…) which breaks equals(…) comparisons of DBObjects in case they use arrays as values. See [0] for details. Adapted usage of Point objects to use asList() over asArray(). [0] https://jira.mongodb.org/browse/JAVA-416 --- .../data/mongodb/repository/MongoParameters.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/MongoParameters.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/MongoParameters.java index a033d10ce..d6e6ea66d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/MongoParameters.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/MongoParameters.java @@ -1,3 +1,18 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.data.mongodb.repository; import java.lang.reflect.Method;