pt.moredata.dao.core
Class SQLSelectBuilder

java.lang.Object
  extended bypt.moredata.dao.core.AbstractSQLStatementBuilder
      extended bypt.moredata.dao.core.SQLSelectBuilder
All Implemented Interfaces:
SQLStatementBuilder

public class SQLSelectBuilder
extends AbstractSQLStatementBuilder
implements SQLStatementBuilder

This class is responsible for building SQL select commands. The commans are build from a DataAccessObject. Company MoreData

Version:
$Revision: 1.20 $
Author:
pcarmo

Field Summary
 
Fields inherited from class pt.moredata.dao.core.AbstractSQLStatementBuilder
_fieldsInfo, _info, _recordSet
 
Constructor Summary
SQLSelectBuilder(DAOFieldsInfo fieldsInfo, RecordSet recordSet)
          Creates a new instance of AbstractSQLStatementBuilder
 
Method Summary
 java.util.List getData(java.sql.ResultSet resultSet)
          Load data from a ResultSet into a list.
protected  java.lang.String getSQLStatement()
          Builds an update SQL command for interacting with a table of a relational database repository.
 void loadData(java.sql.ResultSet resultSet)
          Load data from a ResultSet into the RecordSet.
 void setStatementParameters(java.sql.PreparedStatement statement, SQLInformation info)
          Set the values of a statement parameters.
 
Methods inherited from class pt.moredata.dao.core.AbstractSQLStatementBuilder
getSQLStatement, getStringObjectWithSpaceAtEnd, setDAOFieldsInfo, setRecordSet, setRecordValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pt.moredata.dao.SQLStatementBuilder
getSQLStatement, setDAOFieldsInfo, setRecordSet
 

Constructor Detail

SQLSelectBuilder

public SQLSelectBuilder(DAOFieldsInfo fieldsInfo,
                        RecordSet recordSet)
Creates a new instance of AbstractSQLStatementBuilder

Parameters:
fieldsInfo - The DAO fields information object.
recordSet - The DAO RecordSet object witch contains the DAO data.AbstractSQLStatementBuilder
Method Detail

getSQLStatement

protected java.lang.String getSQLStatement()
Builds an update SQL command for interacting with a table of a relational database repository. The SQL command is specificaly build for the row number. If that row has engine processed fields the SQL command can only be used to update similar rows.

Specified by:
getSQLStatement in class AbstractSQLStatementBuilder
Returns:
A string with the SQL command for interacting with a table of a relational database repository.

setStatementParameters

public void setStatementParameters(java.sql.PreparedStatement statement,
                                   SQLInformation info)
                            throws WriterException
Set the values of a statement parameters.

Specified by:
setStatementParameters in interface SQLStatementBuilder
Parameters:
statement - The prepared statement.
info - Adicional information to help building the sql statement.
Throws:
WriteException - If an error occur will setting the statement parameters.
WriterException

loadData

public void loadData(java.sql.ResultSet resultSet)
              throws ReaderException
Load data from a ResultSet into the RecordSet. This method could and probably would use state build during the execution of the getSQLStatement() method.

Specified by:
loadData in interface SQLStatementBuilder
Parameters:
resultSet - A resultSet with the data to be loaded into the RecordSet.
Throws:
ReaderException

getData

public java.util.List getData(java.sql.ResultSet resultSet)
                       throws ReaderException
Load data from a ResultSet into a list. This method could and probably would use state build during the execution of the getSQLStatement() method.

Parameters:
resultSet - A resultSet with the data to be loaded into the RecordSet.
Throws:
ReaderException