Google

JBoss API: Class JDBCLoadEntitiesCommand

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

java.lang.Object
  |
  +--org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
        |
        +--org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand
              |
              +--org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand
                    |
                    +--org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntitiesCommand
All Implemented Interfaces:
JPMLoadEntitiesCommand, JPMLoadEntityCommand

public class JDBCLoadEntitiesCommand
extends JDBCLoadEntityCommand
implements JPMLoadEntitiesCommand

Implementation of the LoadEntitiesCommand added in JBoss 2.3. This preloads data for all entities whose keys were retrieved by a finder.

Version:
$Revision: 1.4.2.3 $
Author:
Rickard Öberg, Marc Fleury, Joe Shevland, Justin Forder, Dirk Zimmermann, danch (Dan Christopherson)
See Also:

Fields inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
debug, factory, jawsEntity, log, name
 
Constructor Summary
JDBCLoadEntitiesCommand(JDBCCommandFactory factory)
           
 
Method Summary
protected  java.lang.Object createKey(java.sql.ResultSet rs)
           
 void execute(FinderResults keys)
           
protected  java.lang.String getSQL(java.lang.Object argOrArgs)
          Gets the SQL to be used in the PreparedStatement.
protected  java.lang.Object handleResult(java.sql.ResultSet rs, java.lang.Object argOrArgs)
          Handles the result of successful execution of the query.
protected  void preloadOneEntity(java.sql.ResultSet rs, java.lang.Object key)
           
protected  void setParameters(java.sql.PreparedStatement stmt, java.lang.Object argOrArgs)
          Default implementation does nothing.
 
Methods inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand
createSelectClause, execute, isTimedOut, loadFromPreload, loadOneEntity
 
Methods inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand
executeStatementAndHandleResult
 
Methods inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
getCMPFieldValue, getConnection, getJawsCMPFieldJDBCType, getJDBCType, getJDBCTypeName, 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

JDBCLoadEntitiesCommand

public JDBCLoadEntitiesCommand(JDBCCommandFactory factory)
Method Detail

execute

public void execute(FinderResults keys)
             throws java.rmi.RemoteException
Specified by:
execute in interface JPMLoadEntitiesCommand

handleResult

protected java.lang.Object handleResult(java.sql.ResultSet rs,
                                        java.lang.Object argOrArgs)
                                 throws java.lang.Exception
Description copied from class: JDBCQueryCommand
Handles the result of successful execution of the query.
Overrides:
handleResult in class JDBCLoadEntityCommand
Following copied from class: org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand
Parameters:
rs - the result set from the query.
argOrArgs - argument or array of arguments passed in from subclass execute method.
Returns:
any result produced by the handling of the result of executing the prepared statement.
Throws:
java.lang.Exception - if execution or result handling fails.

preloadOneEntity

protected void preloadOneEntity(java.sql.ResultSet rs,
                                java.lang.Object key)

setParameters

protected void setParameters(java.sql.PreparedStatement stmt,
                             java.lang.Object argOrArgs)
                      throws java.lang.Exception
Description copied from class: JDBCCommand
Default implementation does nothing. Override if parameters need to be set.
Overrides:
setParameters in class JDBCLoadEntityCommand
Following copied from class: org.jboss.ejb.plugins.jaws.jdbc.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:
java.lang.Exception - if parameter setting fails.

getSQL

protected java.lang.String getSQL(java.lang.Object argOrArgs)
                           throws java.lang.Exception
Description copied from class: JDBCCommand
Gets the SQL to be used in the PreparedStatement. The default implementation returns the sql field value. This is appropriate in all cases where static SQL can be constructed in the Command constructor. Override if dynamically-generated SQL, based on the arguments given to execute(), is needed.
Overrides:
getSQL in class JDBCCommand
Following copied from class: org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
Parameters:
argOrArgs - argument or array of arguments passed in from subclass execute method.
Returns:
the SQL to use in the PreparedStatement.
Throws:
java.lang.Exception - if an attempt to generate dynamic SQL results in an Exception.

createKey

protected java.lang.Object createKey(java.sql.ResultSet rs)
                              throws java.lang.Exception


Copyright © 2000 The JBoss Organization. All Rights Reserved.