Groovy 1.7.0

## groovy.sql
Class DataSet

    java.lang.Object
      groovy.sql.Sql
          groovy.sql.DataSet

    class DataSet
    extends Sql

Represents an extent of objects

author:
  Chris Stevenson

author:
  Paul King

author:
  James Strachan

version:
  $Revision: 18226 $

Field Summary

Fields inherited from class Sql
log

Constructor Summary
`DataSet(Sql sql, Class type)`
`DataSet(Sql sql, String table)`
`private DataSet(DataSet parent, Closure where)`
`private DataSet(DataSet parent, Closure where, Closure sort)`
`private DataSet(DataSet parent)`

Method Summary
`void` | `add(Map map)`
`void` | `cacheConnection(Closure closure)`
`protected void` | `closeResources(Connection connection, def statement, ResultSet results)`
`protected void` | `closeResources(Connection connection, def statement)`
`void` | `commit()`
`protected Connection` | `createConnection()`
`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()`
`protected SqlOrderByVisitor` | `getSqlOrderByVisitor()`
`protected SqlWhereVisitor` | `getSqlWhereVisitor()`
`DataSet` | `reverse()`
`void` | `rollback()`
`List` | `rows()` Returns a List of all of the rows from the table a DataSet represents
`DataSet` | `sort(Closure sort)`
`void` | `withTransaction(Closure closure)`

Methods inherited from class Sql

ARRAY, BIGINT, BINARY, BIT, BLOB, BOOLEAN, CHAR, CLOB, DATALINK, DATE, DECIMAL, DISTINCT, DOUBLE, FLOAT, INTEGER, JAVA_OBJECT, LONGVARBINARY, LONGVARCHAR, NULL, NUMERIC, OTHER, REAL, REF, SMALLINT, STRUCT, TIME, TIMESTAMP, TINYINT, VARBINARY, VARCHAR, asList, asList, asSql, cacheConnection, cacheStatements, call, call, call, call, call, close, closeResources, closeResources, commit, configure, createConnection, createPreparedQueryCommand, createQueryCommand, dataSet, dataSet, eachRow, eachRow, eachRow, eachRow, eachRow, eachRow, execute, execute, execute, executeInsert, executeInsert, executeInsert, executePreparedQuery, executeQuery, executeUpdate, executeUpdate, executeUpdate, expand, findWhereKeyword, firstRow, firstRow, firstRow, getConnection, getDataSource, getParameters, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, in, inout, isCacheStatements, loadDriver, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, nullify, out, query, query, query, resultSet, rollback, rows, rows, rows, rows, rows, rows, setCacheStatements, setInternalConnection, setObject, setParameters, setResultSetConcurrency, setResultSetHoldability, setResultSetType, withBatch, withStatement, withTransaction

Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Constructor Detail

### DataSet

    public DataSet(Sql sql, Class type)

### DataSet

    public DataSet(Sql sql, String table)

### DataSet

    private DataSet(DataSet parent, Closure where)

### DataSet

    private DataSet(DataSet parent, Closure where, Closure sort)

### DataSet

    private DataSet(DataSet parent)

Method Detail

### add

    public void add(Map map)

### cacheConnection

    @Override
    public void cacheConnection(Closure closure)

### closeResources

    @Override
    protected void closeResources(Connection connection, def statement, ResultSet results)

### closeResources

    @Override
    protected void closeResources(Connection connection, def statement)

### commit

    @Override
    public void commit()

### createConnection

    @Override
    protected Connection createConnection()

### 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()

### getSqlOrderByVisitor

    protected SqlOrderByVisitor getSqlOrderByVisitor()

### getSqlWhereVisitor

    protected SqlWhereVisitor getSqlWhereVisitor()

### reverse

    public DataSet reverse()

### rollback

    @Override
    public void rollback()

### 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)

### withTransaction

    @Override
    public void withTransaction(Closure closure)

Copyright © 2003-2009 The Codehaus. All rights reserved.