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

java.lang.Object
  extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
      extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCUpdateCommand
          extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCStoreEntityCommand
All Implemented Interfaces:
JPMStoreEntityCommand

public class JDBCStoreEntityCommand
extends JDBCUpdateCommand
implements JPMStoreEntityCommand

JAWSPersistenceManager JDBCStoreEntityCommand

Version:
$Revision: 1.10.2.2 $
Author:
Rickard Öberg, Marc Fleury, Joe Shevland, Justin Forder, Sebastien Alborini
See Also:

Nested Class Summary
protected static class JDBCStoreEntityCommand.ExecutionState
           
 
Field Summary
 
Fields inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
factory, jawsEntity, name
 
Constructor Summary
JDBCStoreEntityCommand(JDBCCommandFactory factory)
           
 
Method Summary
protected  boolean changed(Object current, Object old)
           
 void execute(EntityEnterpriseContext ctx)
          if the readOnly flag is specified in the xml file this won't store.
protected  String getSQL(Object argOrArgs)
          Returns dynamically-generated SQL if this entity has tuned updates, otherwise static SQL.
protected  Object handleResult(int rowsAffected, Object argOrArgs)
          Handle the result of successful execution of the update.
protected  String makeSQL(Object argOrArgs)
          Used to create static SQL (tuned = false) or dynamic SQL (tuned = true).
protected  void setParameters(PreparedStatement stmt, Object argOrArgs)
          Default implementation does nothing.
 
Methods inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCUpdateCommand
executeStatementAndHandleResult
 
Methods inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
getCMPFieldValue, getConnection, getJawsCMPFieldJDBCType, getJDBCType, getJDBCTypeName, getName, getPkColumnList, getPkColumnWhereList, getPkFieldValue, getResultObject, getResultObject, getState, isBinaryType, jdbcExecute, setCMPFieldValue, setParameter, setPrimaryKeyParameters, setSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCStoreEntityCommand

public JDBCStoreEntityCommand(JDBCCommandFactory factory)
Method Detail

execute

public void execute(EntityEnterpriseContext ctx)
if the readOnly flag is specified in the xml file this won't store. if not a tuned or untuned update is issued.

Specified by:
execute in interface JPMStoreEntityCommand

getSQL

protected String getSQL(Object argOrArgs)
                 throws Exception
Returns dynamically-generated SQL if this entity has tuned updates, otherwise static SQL.

Overrides:
getSQL in class JDBCCommand
Parameters:
argOrArgs - argument or array of arguments passed in from subclass execute method.
Returns:
the SQL to use in the PreparedStatement.
Throws:
Exception - if an attempt to generate dynamic SQL results in an Exception.

setParameters

protected void setParameters(PreparedStatement stmt,
                             Object argOrArgs)
                      throws Exception
Description copied from class: JDBCCommand
Default implementation does nothing. Override if parameters need to be set.

Overrides:
setParameters in class JDBCCommand
Parameters:
stmt - the PreparedStatement which will be executed by this Command.
argOrArgs - argument or array of arguments passed in from subclass execute method.
Throws:
Exception - if parameter setting fails.

handleResult

protected Object handleResult(int rowsAffected,
                              Object argOrArgs)
                       throws Exception
Description copied from class: JDBCUpdateCommand
Handle the result of successful execution of the update.

Specified by:
handleResult in class JDBCUpdateCommand
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.

changed

protected final boolean changed(Object current,
                                Object old)

makeSQL

protected String makeSQL(Object argOrArgs)
Used to create static SQL (tuned = false) or dynamic SQL (tuned = true).



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