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

java.lang.Object
  extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
      extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand
          extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand
              extended byorg.jboss.ejb.plugins.jaws.jdbc.JDBCPreloadFinderCommand
All Implemented Interfaces:
JPMFindEntitiesCommand
Direct Known Subclasses:
JDBCPreloadByPrimaryKeyCommand

public class JDBCPreloadFinderCommand
extends JDBCFinderCommand

Preloads data for all entities in where clause

Version:
$Revision: 1.7 $

Revisions:

20010621 danch:

20010812 vincent.harcq@hubmethods.com:

  • Get Rid of debug flag, use log4j instead
Author:
danch (Dan Christopherson), Bill Burke
See Also:

Field Summary
protected  JDBCFinderCommand finderDelegate
          The finder we delegate to for setParameters and to get our SQL
protected  JDBCLoadEntityCommand loadCommand
          The load command we delegate to for our column list
 
Fields inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand
finderMetaData
 
Fields inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
factory, jawsEntity, name
 
Constructor Summary
JDBCPreloadFinderCommand(JDBCCommandFactory factory, FinderMetaData f)
           
JDBCPreloadFinderCommand(JDBCCommandFactory factory, JDBCFinderCommand finder)
           
JDBCPreloadFinderCommand(JDBCCommandFactory factory, String name)
           
 
Method Summary
protected  void buildSQL()
          Helper method called by the constructors
protected  Object createKey(ResultSet rs)
           
 String getFromClause()
          This method must be ovverridden to return the full table list for the query, including any join statements.
 String getOrderByClause()
          This method must be ovverridded to return the full order by clause for the query, including the 'ORDER BY' keyword.
 String getWhereClause()
          This method must be overridden to return the where clause used in this query.
protected  Object handleResult(ResultSet rs, Object argOrArgs)
          Handles the result of successful execution of the query.
protected  void preloadOneEntity(ResultSet rs, Object key)
           
protected  void setParameters(PreparedStatement stmt, Object argOrArgs)
          Default implementation does nothing.
 
Methods inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand
execute, getFinderMetaData
 
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, getName, getPkColumnList, getPkColumnWhereList, getPkFieldValue, getResultObject, getResultObject, getSQL, 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
 

Field Detail

finderDelegate

protected JDBCFinderCommand finderDelegate
The finder we delegate to for setParameters and to get our SQL


loadCommand

protected JDBCLoadEntityCommand loadCommand
The load command we delegate to for our column list

Constructor Detail

JDBCPreloadFinderCommand

public JDBCPreloadFinderCommand(JDBCCommandFactory factory,
                                String name)

JDBCPreloadFinderCommand

public JDBCPreloadFinderCommand(JDBCCommandFactory factory,
                                FinderMetaData f)

JDBCPreloadFinderCommand

public JDBCPreloadFinderCommand(JDBCCommandFactory factory,
                                JDBCFinderCommand finder)
Method Detail

getWhereClause

public String getWhereClause()
Description copied from class: JDBCFinderCommand
This method must be overridden to return the where clause used in this query. This must start with the keyword 'WHERE' and include all conditions needed to execute the query properly.

Specified by:
getWhereClause in class JDBCFinderCommand

getFromClause

public String getFromClause()
Description copied from class: JDBCFinderCommand
This method must be ovverridden to return the full table list for the query, including any join statements. This must start with the keyword 'FROM' and include all tables needed to execute the query properly.

Specified by:
getFromClause in class JDBCFinderCommand

getOrderByClause

public String getOrderByClause()
Description copied from class: JDBCFinderCommand
This method must be ovverridded to return the full order by clause for the query, including the 'ORDER BY' keyword.

Specified by:
getOrderByClause in class JDBCFinderCommand

buildSQL

protected void buildSQL()
Helper method called by the constructors


handleResult

protected Object handleResult(ResultSet rs,
                              Object argOrArgs)
                       throws Exception
Description copied from class: JDBCQueryCommand
Handles the result of successful execution of the query.

Overrides:
handleResult in class JDBCFinderCommand
Throws:
Exception

preloadOneEntity

protected void preloadOneEntity(ResultSet rs,
                                Object key)

createKey

protected Object createKey(ResultSet rs)
                    throws Exception
Throws:
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.


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