DATAMONGO-1865 - Polishing.

Adapt to collection name retrieval during query execution. Slightly reword documentation and JavaDoc.

Original pull request: #530.
This commit is contained in:
Mark Paluch
2018-02-14 11:32:37 +01:00
parent c668a47243
commit f1a3c37a79
7 changed files with 12 additions and 14 deletions

View File

@@ -179,7 +179,7 @@ public abstract class AbstractMongoQuery implements RepositoryQuery {
protected abstract boolean isDeleteQuery();
/**
* Return weather the query has an explicit limit set.
* Return whether the query has an explicit limit set.
*
* @return
* @since 2.0.4

View File

@@ -68,11 +68,10 @@ public abstract class AbstractReactiveMongoQuery implements RepositoryQuery {
this.operations = operations;
this.instantiators = new EntityInstantiators();
ReturnedType returnedType = method.getResultProcessor().getReturnedType();
MongoEntityMetadata<?> metadata = method.getEntityInformation();
Class<?> type = metadata.getCollectionEntity().getType();
this.findOperationWithProjection = operations//
.query(returnedType.getDomainType())//
.inCollection(method.getEntityInformation().getCollectionName());
this.findOperationWithProjection = operations.query(type);
}
/*
@@ -214,7 +213,7 @@ public abstract class AbstractReactiveMongoQuery implements RepositoryQuery {
protected abstract boolean isDeleteQuery();
/**
* Return weather the query has an explicit limit set.
* Return whether the query has an explicit limit set.
*
* @return
* @since 2.0.4

View File

@@ -1181,7 +1181,7 @@ public abstract class AbstractPersonRepositoryIntegrationTests {
@Test // DATAMONGO-1865
public void findFirstEntityReturnsFirstResultEvenForNonUniqueMatches() {
repository.findFirstBy();
assertThat(repository.findFirstBy()).isNotNull();
}
@Test(expected = IncorrectResultSizeDataAccessException.class) // DATAMONGO-1865

View File

@@ -75,7 +75,6 @@ public class ReactiveStringBasedMongoQueryUnitTests {
public void setUp() {
when(operations.query(any())).thenReturn(reactiveFind);
when(reactiveFind.inCollection(anyString())).thenReturn(reactiveFind);
this.converter = new MappingMongoConverter(factory, new MongoMappingContext());
}