[ 
https://issues.apache.org/jira/browse/GROOVY-7815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15243316#comment-15243316
 ] 

John Wagenleitner commented on GROOVY-7815:
-------------------------------------------

Placing the Map parameter first allows the following syntax:

{code}
executeInsert('select ...', param1: 'foo', param2: 'bar')
{code}

So you can build the map as the last parameter without having to use the 
bracket literal notation.  However, if you want to pass in an existing Map 
you'd have to use the following:

{code}
def map = [param1: 'foo', param2: 'bar']
executeInsert(map, 'select ...')
{code}

So the method signature is right, just that the typical uses tend to use the 
convenience that Groovy adds of being able to provide the named parameter 
values in-line.

> Sql#executeInsert(Map params, String sql) doc is not reflecting the actual 
> method
> ---------------------------------------------------------------------------------
>
>                 Key: GROOVY-7815
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7815
>             Project: Groovy
>          Issue Type: Documentation
>          Components: SQL processing
>    Affects Versions: 2.4.6
>            Reporter: Ricardo Barros 
>            Priority: Minor
>              Labels: doc,, documentation, executeInsert, sql,
>
> The documentation refers to a method which does not exist, executeInsert(Map 
> params, String sql) the correct signature is (String, Map)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to