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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user