GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1163

groovy.sql.Sql should support closure argument type inferencing inside public methods that take a closure

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.1Release
    • Fix Version/s: None
    • Component/s: Inferencing Engine
    • Labels:
    • Number of attachments :
      0

      Description

      The following groovy groovy.sql.Sql 1.8.1 methods should support type inferencing on closure arguments:

      public java.util.List groovy.sql.Sql.rows(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException                                    
      public java.util.List groovy.sql.Sql.rows(java.lang.String,int,int,groovy.lang.Closure) throws java.sql.SQLException                            
      public java.util.List groovy.sql.Sql.rows(java.lang.String,java.util.List,groovy.lang.Closure) throws java.sql.SQLException                     
      public java.util.List groovy.sql.Sql.rows(java.lang.String,java.util.List,int,int,groovy.lang.Closure) throws java.sql.SQLException             
      public java.util.List groovy.sql.Sql.rows(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException                                 
      public java.util.List groovy.sql.Sql.rows(groovy.lang.GString,int,int,groovy.lang.Closure) throws java.sql.SQLException                         
      public void groovy.sql.Sql.query(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException                                             
      public void groovy.sql.Sql.query(java.lang.String,java.util.List,groovy.lang.Closure) throws java.sql.SQLException                              
      public void groovy.sql.Sql.query(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException                                          
      public void groovy.sql.Sql.call(java.lang.String,java.util.List,groovy.lang.Closure) throws java.lang.Exception                                 
      public void groovy.sql.Sql.call(groovy.lang.GString,groovy.lang.Closure) throws java.lang.Exception                                             
      public void groovy.sql.Sql.eachRow(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException                                           
      public void groovy.sql.Sql.eachRow(java.lang.String,int,int,groovy.lang.Closure) throws java.sql.SQLException                                   
      public void groovy.sql.Sql.eachRow(java.lang.String,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException                       
      public void groovy.sql.Sql.eachRow(java.lang.String,groovy.lang.Closure,int,int,groovy.lang.Closure) throws java.sql.SQLException               
      public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,groovy.lang.Closure,int,int,groovy.lang.Closure) throws java.sql.SQLException
      public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException        
      public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,groovy.lang.Closure) throws java.sql.SQLException                            
      public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,int,int,groovy.lang.Closure) throws java.sql.SQLException                    
      public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException                    
      public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure,int,int,groovy.lang.Closure) throws java.sql.SQLException            
      public void groovy.sql.Sql.eachRow(groovy.lang.GString,int,int,groovy.lang.Closure) throws java.sql.SQLException                                
      public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException                                        
      public synchronized void groovy.sql.Sql.cacheConnection(groovy.lang.Closure) throws java.sql.SQLException                                       
      public synchronized void groovy.sql.Sql.cacheStatements(groovy.lang.Closure) throws java.sql.SQLException                                       
      public void groovy.sql.Sql.withStatement(groovy.lang.Closure)                                                                                   
      public synchronized void groovy.sql.Sql.withTransaction(groovy.lang.Closure) throws java.sql.SQLException                                       
      public int[] groovy.sql.Sql.withBatch(groovy.lang.Closure) throws java.sql.SQLException                                                         
      public int[] groovy.sql.Sql.withBatch(int,groovy.lang.Closure) throws java.sql.SQLException                                                     
      public int[] groovy.sql.Sql.withBatch(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException                                        
      public int[] groovy.sql.Sql.withBatch(int,java.lang.String,groovy.lang.Closure) throws java.sql.SQLException                                    
      

        Activity

        Hide
        Bob Tiernay added a comment -

        As well as the following groovy.sql.* classes and methods:

        groovy.sql.CallResultSet
        	public void groovy.sql.GroovyResultSetExtension.eachRow(groovy.lang.Closure) throws java.sql.SQLException
        
        groovy.sql.DataSet
        	public groovy.sql.DataSet groovy.sql.DataSet.sort(groovy.lang.Closure)
        	public void groovy.sql.DataSet.each(groovy.lang.Closure) throws java.sql.SQLException
        	public groovy.sql.DataSet groovy.sql.DataSet.findAll(groovy.lang.Closure)
        	public void groovy.sql.DataSet.cacheConnection(groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.DataSet.withTransaction(groovy.lang.Closure) throws java.sql.SQLException
        	public groovy.sql.DataSet groovy.sql.DataSet.createView(groovy.lang.Closure)
        	public java.util.List groovy.sql.Sql.rows(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException
        	public java.util.List groovy.sql.Sql.rows(java.lang.String,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public java.util.List groovy.sql.Sql.rows(java.lang.String,java.util.List,groovy.lang.Closure) throws java.sql.SQLException
        	public java.util.List groovy.sql.Sql.rows(java.lang.String,java.util.List,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public java.util.List groovy.sql.Sql.rows(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException
        	public java.util.List groovy.sql.Sql.rows(groovy.lang.GString,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.query(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.query(java.lang.String,java.util.List,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.query(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.call(java.lang.String,java.util.List,groovy.lang.Closure) throws java.lang.Exception
        	public void groovy.sql.Sql.call(groovy.lang.GString,groovy.lang.Closure) throws java.lang.Exception
        	public void groovy.sql.Sql.eachRow(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(java.lang.String,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(java.lang.String,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(java.lang.String,groovy.lang.Closure,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,groovy.lang.Closure,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(java.lang.String,java.util.List,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(groovy.lang.GString,int,int,groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException
        	public synchronized void groovy.sql.Sql.cacheStatements(groovy.lang.Closure) throws java.sql.SQLException
        	public void groovy.sql.Sql.withStatement(groovy.lang.Closure)
        	public int[] groovy.sql.Sql.withBatch(groovy.lang.Closure) throws java.sql.SQLException
        	public int[] groovy.sql.Sql.withBatch(int,groovy.lang.Closure) throws java.sql.SQLException
        	public int[] groovy.sql.Sql.withBatch(java.lang.String,groovy.lang.Closure) throws java.sql.SQLException
        	public int[] groovy.sql.Sql.withBatch(int,java.lang.String,groovy.lang.Closure) throws java.sql.SQLException
        
        groovy.sql.GroovyResultSet
        	public abstract void groovy.sql.GroovyResultSet.eachRow(groovy.lang.Closure) throws java.sql.SQLException
        
        groovy.sql.GroovyResultSetExtension
        	public void groovy.sql.GroovyResultSetExtension.eachRow(groovy.lang.Closure) throws java.sql.SQLException
        
        Show
        Bob Tiernay added a comment - As well as the following groovy.sql.* classes and methods: groovy.sql.CallResultSet public void groovy.sql.GroovyResultSetExtension.eachRow(groovy.lang.Closure) throws java.sql.SQLException groovy.sql.DataSet public groovy.sql.DataSet groovy.sql.DataSet.sort(groovy.lang.Closure) public void groovy.sql.DataSet.each(groovy.lang.Closure) throws java.sql.SQLException public groovy.sql.DataSet groovy.sql.DataSet.findAll(groovy.lang.Closure) public void groovy.sql.DataSet.cacheConnection(groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.DataSet.withTransaction(groovy.lang.Closure) throws java.sql.SQLException public groovy.sql.DataSet groovy.sql.DataSet.createView(groovy.lang.Closure) public java.util.List groovy.sql.Sql.rows(java.lang. String ,groovy.lang.Closure) throws java.sql.SQLException public java.util.List groovy.sql.Sql.rows(java.lang. String , int , int ,groovy.lang.Closure) throws java.sql.SQLException public java.util.List groovy.sql.Sql.rows(java.lang. String ,java.util.List,groovy.lang.Closure) throws java.sql.SQLException public java.util.List groovy.sql.Sql.rows(java.lang. String ,java.util.List, int , int ,groovy.lang.Closure) throws java.sql.SQLException public java.util.List groovy.sql.Sql.rows(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException public java.util.List groovy.sql.Sql.rows(groovy.lang.GString, int , int ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.query(java.lang. String ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.query(java.lang. String ,java.util.List,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.query(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.call(java.lang. String ,java.util.List,groovy.lang.Closure) throws java.lang.Exception public void groovy.sql.Sql.call(groovy.lang.GString,groovy.lang.Closure) throws java.lang.Exception public void groovy.sql.Sql.eachRow(java.lang. String ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(java.lang. String , int , int ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(java.lang. String ,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(java.lang. String ,groovy.lang.Closure, int , int ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(java.lang. String ,java.util.List,groovy.lang.Closure, int , int ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(java.lang. String ,java.util.List,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(java.lang. String ,java.util.List,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(java.lang. String ,java.util.List, int , int ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure, int , int ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(groovy.lang.GString, int , int ,groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.eachRow(groovy.lang.GString,groovy.lang.Closure) throws java.sql.SQLException public synchronized void groovy.sql.Sql.cacheStatements(groovy.lang.Closure) throws java.sql.SQLException public void groovy.sql.Sql.withStatement(groovy.lang.Closure) public int [] groovy.sql.Sql.withBatch(groovy.lang.Closure) throws java.sql.SQLException public int [] groovy.sql.Sql.withBatch( int ,groovy.lang.Closure) throws java.sql.SQLException public int [] groovy.sql.Sql.withBatch(java.lang. String ,groovy.lang.Closure) throws java.sql.SQLException public int [] groovy.sql.Sql.withBatch( int ,java.lang. String ,groovy.lang.Closure) throws java.sql.SQLException groovy.sql.GroovyResultSet public abstract void groovy.sql.GroovyResultSet.eachRow(groovy.lang.Closure) throws java.sql.SQLException groovy.sql.GroovyResultSetExtension public void groovy.sql.GroovyResultSetExtension.eachRow(groovy.lang.Closure) throws java.sql.SQLException
        Hide
        Andrew Eisenberg added a comment -

        I can do something here, but there's not a whole lot since the closure parameters are mostly just map, but we don't know much more than that.

        Show
        Andrew Eisenberg added a comment - I can do something here, but there's not a whole lot since the closure parameters are mostly just map, but we don't know much more than that.
        Hide
        Bob Tiernay added a comment - - edited

        Actually, some methods take a Connection, Statement, BatchingStatementWrapper, BatchingPreparedStatementWrapper, ResultSetMetaData, GroovyResultSet, ResultSet or GroovyRowResult

        See http://groovy.codehaus.org/api/groovy/sql/Sql.html and search for "argument"

        Show
        Bob Tiernay added a comment - - edited Actually, some methods take a Connection , Statement , BatchingStatementWrapper , BatchingPreparedStatementWrapper , ResultSetMetaData , GroovyResultSet , ResultSet or GroovyRowResult See http://groovy.codehaus.org/api/groovy/sql/Sql.html and search for "argument"

          People

          • Assignee:
            Unassigned
            Reporter:
            Bob Tiernay
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: