You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DATAMONGO-871 - Add support for arrays as query method return types.
Changed AbstractMongoQuery to potentially convert all query execution results using the DefaultConversionService in case the query result doesn't match the expected return value.
This allows arrays to be returned for collection queries as the conversion service cam transparently convert between collections and arrays.
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractMongoQuery.java
+9-7
Original file line number
Diff line number
Diff line change
@@ -82,24 +82,26 @@ public Object execute(Object[] parameters) {
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/AbstractPersonRepositoryIntegrationTests.java
+12
Original file line number
Diff line number
Diff line change
@@ -750,4 +750,16 @@ public void findsSliceOfPersons() {
750
750
751
751
assertThat(result.hasNext(), is(true));
752
752
}
753
+
754
+
/**
755
+
* @see DATAMONGO-871
756
+
*/
757
+
@Test
758
+
publicvoidfindsPersonsByFirstnameAsArray() {
759
+
760
+
Person[] result = repository.findByThePersonsFirstnameAsArray("Leroi");
0 commit comments