bootiful-sqltemplate-core/src/main/java/ninja/cero/sqltemplate/core/SqlTemplate.java
public <U> U forStream(
            String fileName,
            Function<? super Stream<Map<String, Object>>, U> handleStream) {
        String sql = getTemplate(fileName, EMPTY_ARGS);
        PreparedStatementSetter pss = paramBuilder.byArgs(new Object[0]);
        RowMapper<Map<String, Object>> mapper = new ColumnMapRowMapper();
        return queryStreamWithOrdinalParams(sql, pss, mapper, handleStream);
    }
public <U> U forStream(
            String fileName,
            Function<? super Stream<Map<String, Object>>, U> handleStream) {
        String sql = getTemplate(fileName, EMPTY_ARGS);
        PreparedStatementSetter pss = paramBuilder.byArgs(new Object[0]);
        RowMapper<Map<String, Object>> mapper = new ColumnMapRowMapper();
        return queryStreamWithOrdinalParams(sql, pss, mapper, handleStream);
    }
public < U > U forStream ( String fileName , Function < ? super Stream < Map < String , Object > > , U > handleStream ) { String sql = getTemplate ( fileName , EMPTY_ARGS ) ; PreparedStatementSetter pss = paramBuilder . byArgs ( new Object [ 0 ] ) ; RowMapper < Map < String , Object > > mapper = new ColumnMapRowMapper ( ) ; return queryStreamWithOrdinalParams ( sql , pss , mapper , handleStream ) ; }
Executes a query,
passing the column maps to {@code handleStream} as a stream.

<p>Example usage:</p>

<pre>
int totalSalary = sqlTemplate.forStream("/path/to/query.sql",
mapStream -&gt; mapStream.mapToInt(map -&gt; (Integer) map.get("salary")).sum());
</pre>

@param fileName SQL specifier
@param handleStream the function which is applied to the stream
@param <U> the result type
@return the result of {@code handleStream}
@throws org.springframework.dao.DataAccessException if there is any problem
Executes a query passing the column maps to { @code handleStream } as a stream .