org.jboss.ejb.plugins.jaws.jdbc
Class JDBCUpdateCommand

java.lang.Object
  extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
      extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCUpdateCommand
Direct Known Subclasses:
JDBCCreateEntityCommand, JDBCDestroyCommand, JDBCInitCommand, JDBCRemoveEntityCommand, JDBCStoreEntityCommand

public abstract class JDBCUpdateCommand
extends JDBCCommand

Abstract superclass for all JAWS Commands that issue JDBC updates directly. Provides a Template Method implementation for executeStatementAndHandleResult.

Version:
$Revision: 1.8 $

Revisions:

20010812 vincent.harcq@hubmethods.com:

Author:
Justin Forder

Field Summary
 
Fields inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
factory, jawsEntity, name
 
Constructor Summary
protected JDBCUpdateCommand(JDBCCommandFactory factory, String name)
          Pass the arguments on to the superclass constructor.
 
Method Summary
protected  Object executeStatementAndHandleResult(PreparedStatement stmt, Object argOrArgs)
          Template Method that executes the PreparedStatement and calls handleResult on the integer result.
protected abstract  Object handleResult(int rowsAffected, Object argOrArgs)
          Handle the result of successful execution of the update.
 
Methods inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
getCMPFieldValue, getConnection, getJawsCMPFieldJDBCType, getJDBCType, getJDBCTypeName, getName, getPkColumnList, getPkColumnWhereList, getPkFieldValue, getResultObject, getResultObject, getSQL, getState, isBinaryType, jdbcExecute, setCMPFieldValue, setParameter, setParameters, setPrimaryKeyParameters, setSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCUpdateCommand

protected JDBCUpdateCommand(JDBCCommandFactory factory,
                            String name)
Pass the arguments on to the superclass constructor.

Method Detail

executeStatementAndHandleResult

protected Object executeStatementAndHandleResult(PreparedStatement stmt,
                                                 Object argOrArgs)
                                          throws Exception
Template Method that executes the PreparedStatement and calls handleResult on the integer result.

Specified by:
executeStatementAndHandleResult in class JDBCCommand
Parameters:
stmt - the prepared statement, with its parameters already set.
argOrArgs - argument or array of arguments passed in from subclass execute method.
Returns:
the result from handleResult.
Throws:
Exception - if execution or result handling fails.

handleResult

protected abstract Object handleResult(int rowsAffected,
                                       Object argOrArgs)
                                throws Exception
Handle the result of successful execution of the update.

Parameters:
argOrArgs - argument or array of arguments passed in from subclass execute method.
Returns:
any result needed by the subclass execute.
Throws:
Exception - if result handling fails.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.