DATAMONGO-2374 - Polishing.
Reformat code. Original pull request: #791.
This commit is contained in:
@@ -68,7 +68,7 @@ class PropertyOperations {
|
||||
} else {
|
||||
|
||||
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(targetType);
|
||||
if(entity != null) {
|
||||
if (entity != null) {
|
||||
entity.doWithProperties(
|
||||
(SimplePropertyHandler) persistentProperty -> projectedFields.append(persistentProperty.getName(), 1));
|
||||
}
|
||||
|
||||
@@ -36,8 +36,6 @@ import org.springframework.data.util.TypeInformation;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
import com.mongodb.client.result.DeleteResult;
|
||||
|
||||
/**
|
||||
* Set of classes to contain query execution strategies. Depending (mostly) on the return type of a
|
||||
* {@link org.springframework.data.repository.query.QueryMethod} a {@link AbstractReactiveMongoQuery} can be executed in
|
||||
@@ -174,7 +172,7 @@ interface ReactiveMongoQueryExecution {
|
||||
return source;
|
||||
}
|
||||
|
||||
if(!operations.getConverter().getMappingContext().hasPersistentEntityFor(returnedType.getReturnedType())) {
|
||||
if (!operations.getConverter().getMappingContext().hasPersistentEntityFor(returnedType.getReturnedType())) {
|
||||
return source;
|
||||
}
|
||||
|
||||
|
||||
@@ -360,9 +360,10 @@ public interface PersonRepository extends MongoRepository<Person, String>, Query
|
||||
@Query(value = "{ 'id' : ?0 }", fields = "{ 'fans': { '$slice': [ ?1, ?2 ] } }")
|
||||
Person findWithSliceInProjection(String id, int skip, int limit);
|
||||
|
||||
@Query(value = "{ 'shippingAddresses' : { '$elemMatch' : { 'city' : { '$eq' : 'lnz' } } } }", fields = "{ 'shippingAddresses.$': ?0 }")
|
||||
@Query(value = "{ 'shippingAddresses' : { '$elemMatch' : { 'city' : { '$eq' : 'lnz' } } } }",
|
||||
fields = "{ 'shippingAddresses.$': ?0 }")
|
||||
Person findWithArrayPositionInProjection(int position);
|
||||
|
||||
@Query(value="{_id:?0}")
|
||||
@Query(value = "{_id:?0}")
|
||||
Optional<org.bson.Document> findDocumentById(String id);
|
||||
}
|
||||
|
||||
@@ -281,9 +281,9 @@ public class ReactiveMongoRepositoryTests implements BeanClassLoaderAware, BeanF
|
||||
repository.findByLocationNear(new Point(-73.99, 40.73), //
|
||||
new Distance(2000, Metrics.KILOMETERS)).as(StepVerifier::create).consumeNextWith(actual -> {
|
||||
|
||||
assertThat(actual.getDistance().getValue()).isCloseTo(1, offset(1d));
|
||||
assertThat(actual.getContent()).isEqualTo(dave);
|
||||
}).verifyComplete();
|
||||
assertThat(actual.getDistance().getValue()).isCloseTo(1, offset(1d));
|
||||
assertThat(actual.getContent()).isEqualTo(dave);
|
||||
}).verifyComplete();
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1444
|
||||
|
||||
Reference in New Issue
Block a user