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

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
All Implemented Interfaces:
JPMFindEntitiesCommand
Direct Known Subclasses:
JDBCDefinedFinderCommand, JDBCFindAllCommand, JDBCFindByCommand, JDBCPreloadFinderCommand

public abstract class JDBCFinderCommand
extends JDBCQueryCommand
implements JPMFindEntitiesCommand

Abstract superclass of finder commands that return collections. Provides the handleResult() implementation that these all need.

Version:
$Revision: 1.19.2.1 $

Revisions:

20010621 Bill Burke:

20010812 vincent.harcq@hubmethods.com:

20020525 Dain Sundstrom:

Author:
Rickard Öberg, Marc Fleury, Joe Shevland, Justin Forder, Bill Burke
See Also:

Field Summary
protected  FinderMetaData finderMetaData
           
 
Fields inherited from class org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand
factory, jawsEntity, name
 
Constructor Summary
JDBCFinderCommand(JDBCCommandFactory factory, FinderMetaData f)
           
JDBCFinderCommand(JDBCCommandFactory factory, String name)
           
 
Method Summary
 Collection execute(Method finderMethod, Object[] args, EntityEnterpriseContext ctx)
           
 FinderMetaData getFinderMetaData()
           
abstract  String getFromClause()
          This method must be ovverridden to return the full table list for the query, including any join statements.
abstract  String getOrderByClause()
          This method must be ovverridded to return the full order by clause for the query, including the 'ORDER BY' keyword.
abstract  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.
 
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, setParameters, setPrimaryKeyParameters, setSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

finderMetaData

protected FinderMetaData finderMetaData
Constructor Detail

JDBCFinderCommand

public JDBCFinderCommand(JDBCCommandFactory factory,
                         String name)

JDBCFinderCommand

public JDBCFinderCommand(JDBCCommandFactory factory,
                         FinderMetaData f)
Method Detail

getFinderMetaData

public FinderMetaData getFinderMetaData()

getWhereClause

public abstract String getWhereClause()
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.


getFromClause

public abstract String getFromClause()
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.


getOrderByClause

public abstract String getOrderByClause()
This method must be ovverridded to return the full order by clause for the query, including the 'ORDER BY' keyword.


execute

public Collection execute(Method finderMethod,
                          Object[] args,
                          EntityEnterpriseContext ctx)
                   throws javax.ejb.FinderException
Specified by:
execute in interface JPMFindEntitiesCommand
Throws:
javax.ejb.FinderException

handleResult

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

Specified by:
handleResult in class 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:
Exception - if execution or result handling fails.


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