138
138
* @author Chuong Ngo
139
139
* @author Christoph Strobl
140
140
* @author Doménique Tilleuil
141
+ * @author Niko Schmuck
141
142
*/
142
143
@ SuppressWarnings ("deprecation" )
143
144
public class MongoTemplate implements MongoOperations , ApplicationContextAware {
@@ -334,7 +335,7 @@ public <T> CloseableIterator<T> stream(final Query query, final Class<T> entityT
334
335
* @see org.springframework.data.mongodb.core.MongoOperations#stream(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
335
336
*/
336
337
@ Override
337
- public <T > CloseableIterator <T > stream (final Query query , final Class <T > entityType , String collectionName ) {
338
+ public <T > CloseableIterator <T > stream (final Query query , final Class <T > entityType , final String collectionName ) {
338
339
339
340
Assert .notNull (query , "Query must not be null!" );
340
341
Assert .notNull (entityType , "Entity type must not be null!" );
@@ -353,8 +354,7 @@ public CloseableIterator<T> doInCollection(DBCollection collection) throws Mongo
353
354
DBCursor cursor = collection .find (mappedQuery , mappedFields );
354
355
QueryCursorPreparer cursorPreparer = new QueryCursorPreparer (query , entityType );
355
356
356
- ReadDbObjectCallback <T > readCallback = new ReadDbObjectCallback <T >(mongoConverter , entityType ,
357
- collection .getName ());
357
+ ReadDbObjectCallback <T > readCallback = new ReadDbObjectCallback <T >(mongoConverter , entityType , collectionName );
358
358
359
359
return new CloseableIterableCursorAdapter <T >(cursorPreparer .prepare (cursor ), exceptionTranslator , readCallback );
360
360
}
0 commit comments