org.apache.tuscany.das.rdb.impl
Class ReadCommandImpl

java.lang.Object
  extended by org.apache.tuscany.das.rdb.impl.BaseCommandImpl
      extended by org.apache.tuscany.das.rdb.impl.CommandImpl
          extended by org.apache.tuscany.das.rdb.impl.ReadCommandImpl
All Implemented Interfaces:
Command
Direct Known Subclasses:
SPCommandImpl

public class ReadCommandImpl
extends CommandImpl


Field Summary
 
Fields inherited from class org.apache.tuscany.das.rdb.impl.CommandImpl
parameters, resultSetShape, statement
 
Fields inherited from class org.apache.tuscany.das.rdb.impl.BaseCommandImpl
configWrapper
 
Constructor Summary
ReadCommandImpl(Command command, MappingWrapper mapping, java.util.List resultDescriptor)
           
ReadCommandImpl(java.lang.String sqlString, MappingWrapper mapping, java.util.List resultDescriptor)
           
 
Method Summary
 void addResultDescriptor(ResultDescriptor resultDescriptor)
          Add/replace based on columnIndex (>=0)embedded in resultDescriptor else add at end
protected  commonj.sdo.DataObject buildGraph(java.util.List results)
           
protected  void enablePaging()
           
 void execute()
          Performs the function defined by the command
 commonj.sdo.DataObject executeQuery()
          Performs the function defined by the command and return the results in the root DataObject
protected  int getEndRow()
           
 ResultDescriptor getResultDescriptor(int columnIndex)
          Return resultDescriptor if exact match for columnIndex(>=0) found else return null;
 java.util.List getResultDescriptors()
           
protected  int getStartRow()
           
 void printResultDescriptors(java.io.OutputStream ostrm)
          Utility method
 ResultDescriptor removeResultDescriptor(int columnIndex)
          remove ResultDescriptor at given columnIndex(>=0) and return same.
 ResultDescriptor removeResultDescriptor(ResultDescriptor resultDescriptor)
          Remove resultDescriptor only if matched for index(>=0), name, type, schema name and table name and return same, else return null For -ve index, ignore index and if unique match for rest of the attriutes, remove/return, if multiple matches found, throw RuntimeException
protected  void setEndRow(int endRow)
           
 void setResultDescriptors(java.util.List resultDescriptors)
          When any columnIndex == -ve, sorting will not happen in ResultShapeSorter (old way) When null is passed, set this.resultSetShape to null, this will later trigger, dbms metadata based shaping of result
protected  void setStartRow(int startRow)
           
 
Methods inherited from class org.apache.tuscany.das.rdb.impl.CommandImpl
addParameter, close, getConnection, getGeneratedKey, getParameter, getParameter, getParameters, setConnection, setParameter, setParameter
 
Methods inherited from class org.apache.tuscany.das.rdb.impl.BaseCommandImpl
setConnection, setConnection, setConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadCommandImpl

public ReadCommandImpl(Command command,
                       MappingWrapper mapping,
                       java.util.List resultDescriptor)

ReadCommandImpl

public ReadCommandImpl(java.lang.String sqlString,
                       MappingWrapper mapping,
                       java.util.List resultDescriptor)
Method Detail

setResultDescriptors

public void setResultDescriptors(java.util.List resultDescriptors)
When any columnIndex == -ve, sorting will not happen in ResultShapeSorter (old way) When null is passed, set this.resultSetShape to null, this will later trigger, dbms metadata based shaping of result


getResultDescriptors

public java.util.List getResultDescriptors()

addResultDescriptor

public void addResultDescriptor(ResultDescriptor resultDescriptor)
Description copied from interface: Command
Add/replace based on columnIndex (>=0)embedded in resultDescriptor else add at end


removeResultDescriptor

public ResultDescriptor removeResultDescriptor(int columnIndex)
Description copied from interface: Command
remove ResultDescriptor at given columnIndex(>=0) and return same. If not present return null. For -ve index, return null

Returns:

removeResultDescriptor

public ResultDescriptor removeResultDescriptor(ResultDescriptor resultDescriptor)
Description copied from interface: Command
Remove resultDescriptor only if matched for index(>=0), name, type, schema name and table name and return same, else return null For -ve index, ignore index and if unique match for rest of the attriutes, remove/return, if multiple matches found, throw RuntimeException

Returns:

getResultDescriptor

public ResultDescriptor getResultDescriptor(int columnIndex)
Description copied from interface: Command
Return resultDescriptor if exact match for columnIndex(>=0) found else return null;

Returns:

printResultDescriptors

public void printResultDescriptors(java.io.OutputStream ostrm)
                            throws java.io.IOException
Description copied from interface: Command
Utility method

Throws:
java.io.IOException

execute

public void execute()
Description copied from interface: Command
Performs the function defined by the command

Specified by:
execute in interface Command
Specified by:
execute in class CommandImpl

executeQuery

public commonj.sdo.DataObject executeQuery()
Description copied from interface: Command
Performs the function defined by the command and return the results in the root DataObject

Specified by:
executeQuery in interface Command
Specified by:
executeQuery in class CommandImpl
Returns:
the root DataObject

buildGraph

protected commonj.sdo.DataObject buildGraph(java.util.List results)
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

getStartRow

protected int getStartRow()

getEndRow

protected int getEndRow()

setStartRow

protected void setStartRow(int startRow)

setEndRow

protected void setEndRow(int endRow)

enablePaging

protected void enablePaging()


Copyright © 2007 Apache Software Foundation. All Rights Reserved.