[
https://issues.apache.org/jira/browse/GROOVY-11936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-11936.
--------------------------------
Fix Version/s: 6.0.0-alpha-1
Assignee: Paul King
Resolution: Fixed
> Add Map-based named-parameter overloads for call/callWithRows/callWithAllRows
> -----------------------------------------------------------------------------
>
> Key: GROOVY-11936
> URL: https://issues.apache.org/jira/browse/GROOVY-11936
> Project: Groovy
> Issue Type: Improvement
> Components: SQL processing
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Fix For: 6.0.0-alpha-1
>
>
> This is to capture a hidden feature proposal from [~oniseijin] buried in
> comments in GROOVY-7768.
> Basically:
> {code:groovy}
> sql.callWithAllRows '{call sp_who(:id)}', [id: 'myid'], { /* no out params */
> }
> {code}
> Instead of:
> {code:groovy}
> sql.callWithAllRows '{call sp_who(?)}', ['myid'], { ... }
> {code}
> Or another contrived example:
> {code:groovy}
> def rows = sql.callWithRows '{call FindAllByFirstWithTotal(:first, :total)}',
> [first: 'J', total: Sql.VARCHAR], { total ->
> assert total == 'Found total 2'
> }
> assert rows.size() == 2
> {code}
> Or this:
> {code:groovy}
> def rowList = sql.callWithAllRows
> '{call FindAllByFirstAndFindAllByLastWithTotals(:first, :last, :firstOut,
> :lastOut)}',
> [first: 'J', last: 'V', firstOut: Sql.VARCHAR, lastOut: Sql.VARCHAR],
> { firstTotal, lastTotal ->
> assert firstTotal == 'Found total 2'
> assert lastTotal == 'Found total 1'
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)