You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2017/05/04 00:38:04 UTC

[jira] [Created] (GROOVY-8175) MyBatis-like bind variable for GroovySql

Daniel Sun created GROOVY-8175:
----------------------------------

             Summary: MyBatis-like bind variable for GroovySql
                 Key: GROOVY-8175
                 URL: https://issues.apache.org/jira/browse/GROOVY-8175
             Project: Groovy
          Issue Type: Improvement
            Reporter: Daniel Sun


As the code shows, we can bind variables elegantly.
{code}
   def sql = Sql.newInstance(...) 
   sql.eachRow("select * from some_table where some_col=#{someColValue} and some_col2=#{someCol2Value}", [someColValue:'foo', someCol2Value:'bar']) { row ->
      println row
   } 
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)