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

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.WriteCommandImpl
All Implemented Interfaces:
Command
Direct Known Subclasses:
DeleteCommandImpl, InsertCommandImpl, UpdateCommandImpl

public abstract class WriteCommandImpl
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
WriteCommandImpl(Command command)
           
WriteCommandImpl(java.lang.String sqlString)
           
 
Method Summary
protected  void addParameters(Parameters parameters)
           
 void addResultDescriptor(ResultDescriptor resultDescriptor)
          Add/replace based on columnIndex (>=0)embedded in resultDescriptor else add at end
 void basicExecute()
           
 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
 int getGeneratedKey()
          Returns the value of the database-generated key.
 Config getMappingModel()
           
 ResultDescriptor getResultDescriptor(int index)
          Return resultDescriptor if exact match for columnIndex(>=0) found else return null;
 java.util.List getResultDescriptors()
           
 void printResultDescriptors(java.io.OutputStream ostrm)
          Utility method
 ResultDescriptor removeResultDescriptor(int index)
          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
 void setResultDescriptors(java.util.List resultDescriptorList)
          Allow set of ResultDescriptor when command is created on-the-fly
 java.lang.String toString()
           
 
Methods inherited from class org.apache.tuscany.das.rdb.impl.CommandImpl
addParameter, close, getConnection, 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, wait, wait, wait
 

Constructor Detail

WriteCommandImpl

public WriteCommandImpl(Command command)

WriteCommandImpl

public WriteCommandImpl(java.lang.String sqlString)
Method Detail

setResultDescriptors

public void setResultDescriptors(java.util.List resultDescriptorList)
Description copied from interface: Command
Allow set of ResultDescriptor when command is created on-the-fly


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

basicExecute

public void basicExecute()

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

getMappingModel

public Config getMappingModel()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getGeneratedKey

public int getGeneratedKey()
Description copied from interface: Command
Returns the value of the database-generated key. This method is specific to an "insert" command and will be valid only after the command has been executed.

Specified by:
getGeneratedKey in interface Command
Overrides:
getGeneratedKey in class CommandImpl
Returns:
the generated key

addParameters

protected void addParameters(Parameters parameters)


Copyright © 2007 Apache Software Foundation. All Rights Reserved.