groovy.sql
Class DataSet

Represents an extent of objects

author:
Chris Stevenson
author:
Paul King
author:
James Strachan
version:
$Revision: 10922 $

Field Summary
 List params
           
 DataSet parent
           
 boolean reversed
           
 Closure sort
           
 SqlOrderByVisitor sortVisitor
           
 String sql
           
 String table
           
 SqlWhereVisitor visitor
           
 Closure where
           
 
Constructor Summary
DataSet(Sql sql, Class type)
           
DataSet(Sql sql, String table)
           
DataSet(DataSet parent, Closure where)
           
DataSet(DataSet parent, Closure where, Closure sort)
           
DataSet(DataSet parent)
           
 
Method Summary
void add(Map values)
          
DataSet createView(Closure criteria)
          
void each(Closure closure)
          
DataSet findAll(Closure where)
          
Object firstRow()
           Returns the first row from a DataSet's underlying table
List getParameters()
          
String getSql()
          
String getSqlOrderBy()
          
SqlOrderByVisitor getSqlOrderByVisitor()
          
String getSqlWhere()
          
SqlWhereVisitor getSqlWhereVisitor()
          
DataSet reverse()
          
List rows()
           Returns a List of all of the rows from the table a DataSet represents
DataSet sort(Closure sort)
          
void visit(Closure closure, CodeVisitorSupport visitor)
          
 

Constructor Detail

DataSet

public DataSet(Sql sql, Class type)


DataSet

public DataSet(Sql sql, String table)


DataSet

DataSet(DataSet parent, Closure where)


DataSet

DataSet(DataSet parent, Closure where, Closure sort)


DataSet

DataSet(DataSet parent)


Method Detail

add

public void add(Map values)


createView

public DataSet createView(Closure criteria)


each

public void each(Closure closure)


findAll

public DataSet findAll(Closure where)


firstRow

public Object firstRow()
Returns the first row from a DataSet's underlying table
return:
Returns the first GroovyRowResult object from the dataset
throws:
SQLException if a database error occurs


getParameters

public List getParameters()


getSql

public String getSql()


getSqlOrderBy

String getSqlOrderBy()


getSqlOrderByVisitor

SqlOrderByVisitor getSqlOrderByVisitor()


getSqlWhere

String getSqlWhere()


getSqlWhereVisitor

SqlWhereVisitor getSqlWhereVisitor()


reverse

public DataSet reverse()


rows

public List rows()
Returns a List of all of the rows from the table a DataSet represents
return:
Returns a list of GroovyRowResult objects from the dataset
throws:
SQLException if a database error occurs


sort

public DataSet sort(Closure sort)


visit

void visit(Closure closure, CodeVisitorSupport visitor)