com.agimatec.sql.query
Class ArrayResultBuilder

java.lang.Object
  extended by com.agimatec.sql.query.ArrayResultBuilder
All Implemented Interfaces:
JdbcResultBuilder

public class ArrayResultBuilder
extends java.lang.Object
implements JdbcResultBuilder

Default QueryResultVisitor that creates Object[] with the row data. This class is neither thread-safe, nor stateless.


Field Summary
protected  int[] colTypes
           
protected  int numCols
           
protected  java.util.List result
           
protected  java.lang.Object[] row
           
 
Constructor Summary
ArrayResultBuilder()
           
 
Method Summary
 void afterExecute(java.sql.ResultSetMetaData rsmData, java.lang.Object queryObject, java.util.List resultList)
          The init() method is called once after the SQL statement has been executed and the result set is known.
 void close(boolean isComplete)
          The close() method is invoked, just BEFORE all associated resources (e.g. resultSet) are closed by the caller.
 void fetch(java.sql.ResultSet resultSet)
          create an Object[] with the data from the resultSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numCols

protected int numCols

result

protected java.util.List result

colTypes

protected int[] colTypes

row

protected java.lang.Object[] row
Constructor Detail

ArrayResultBuilder

public ArrayResultBuilder()
Method Detail

afterExecute

public void afterExecute(java.sql.ResultSetMetaData rsmData,
                         java.lang.Object queryObject,
                         java.util.List resultList)
                  throws java.sql.SQLException
Description copied from interface: JdbcResultBuilder
The init() method is called once after the SQL statement has been executed and the result set is known.

Specified by:
afterExecute in interface JdbcResultBuilder
Parameters:
rsmData - JDBC result set meta data.
resultList - The List where the result objects are added to.
Throws:
java.sql.SQLException

fetch

public void fetch(java.sql.ResultSet resultSet)
           throws java.sql.SQLException
create an Object[] with the data from the resultSet. add one Object[] to the result List.

Specified by:
fetch in interface JdbcResultBuilder
Parameters:
resultSet - the ResultSet where the cursor is located on the current row
Throws:
java.sql.SQLException

close

public void close(boolean isComplete)
Description copied from interface: JdbcResultBuilder
The close() method is invoked, just BEFORE all associated resources (e.g. resultSet) are closed by the caller. The close() method is the last callback to the visitor that allows to add pending results to the result list and to close own resources.

Specified by:
close in interface JdbcResultBuilder


Copyright © 2008-2012. All Rights Reserved.