BEA Systems, Inc.

com.beasys.commerce.axiom.document.jdbc
Class SearchStatement

java.lang.Object
  |
  +--com.beasys.commerce.axiom.document.jdbc.CallableStatement
        |
        +--com.beasys.commerce.axiom.document.jdbc.SearchStatement
Direct Known Subclasses:
FindDocumentIdsStatement, FindDocumentMetadataStatement, FindDocumentsStatement

public abstract class SearchStatement
extends CallableStatement

A callable statement which handles turning Search parameters into DocumentIterators.

This expects InParam1 to be either a Search or a string query which can be converted to a Search. OutParam1 will be the DocumentIterator of the type the subclasses searches for.

This is abstract -- subclasses must implement the createIterator(com.beasys.commerce.axiom.document.spi.DocumentProvider, com.beasys.commerce.foundation.expression.Search) method.


Field Summary
protected  DocumentIterator iterator
          OutParam1: the DocumentIterator.
protected  Search searchParameters
          InParam1: the search parameters.
 
Fields inherited from class com.beasys.commerce.axiom.document.jdbc.CallableStatement
connection
 
Constructor Summary
SearchStatement(Connection con)
          Constructor.
 
Method Summary
 void clearParameters()
          Clear the parameters.
 void close()
          Close the statement and any related resources.
protected  void closeIterator()
          Close the open document iterator.
protected abstract  DocumentIterator createIterator(DocumentProvider p, Search params)
          This method is invoked to generate the DocumentIterator for this object.
 boolean execute()
          Execute the statement.
 java.lang.Object getObject(int index)
          Get the output parameter.
 void setObject(int index, java.lang.Object obj)
          Set the input parameter.
 void setString(int index, java.lang.String str)
          Set the input parameter string.
 
Methods inherited from class com.beasys.commerce.axiom.document.jdbc.CallableStatement
addBatch, addBatch, cancel, clearBatch, clearWarnings, execute, executeBatch, executeQuery, executeQuery, executeUpdate, executeUpdate, getArray, getBigDecimal, getBigDecimal, getBlob, getBoolean, getByte, getBytes, getClob, getConnection, getDate, getDate, getDocumentProvider, getDouble, getFetchDirection, getFetchSize, getFloat, getInt, getLong, getMaxFieldSize, getMaxRows, getMetaData, getMoreResults, getObject, getQueryTimeout, getRef, getResultSet, getResultSetConcurrency, getResultSetType, getShort, getString, getTime, getTime, getTimestamp, getTimestamp, getUpdateCount, getWarnings, registerOutParameter, registerOutParameter, registerOutParameter, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setCursorName, setDate, setDate, setDouble, setEscapeProcessing, setFetchDirection, setFetchSize, setFloat, setInt, setLong, setMaxFieldSize, setMaxRows, setNull, setNull, setObject, setObject, setQueryTimeout, setRef, setShort, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, wasNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

searchParameters

protected Search searchParameters
InParam1: the search parameters.

iterator

protected DocumentIterator iterator
OutParam1: the DocumentIterator.
Constructor Detail

SearchStatement

public SearchStatement(Connection con)
Constructor.
Parameters:
con - the connection that spawned us.
Method Detail

closeIterator

protected void closeIterator()
Close the open document iterator.

close

public void close()
Close the statement and any related resources.
Overrides:
close in class CallableStatement
See Also:
closeIterator()

clearParameters

public void clearParameters()
Clear the parameters.
Overrides:
clearParameters in class CallableStatement
See Also:
closeIterator()

execute

public boolean execute()
                throws java.sql.SQLException
Execute the statement.
Overrides:
execute in class CallableStatement
Throws:
java.sql.SQLException - thrown on an error.

createIterator

protected abstract DocumentIterator createIterator(DocumentProvider p,
                                                   Search params)
                                            throws DocumentException
This method is invoked to generate the DocumentIterator for this object.
Parameters:
p - the DocumentProvider to use.
params - the Search parameters passed into the statement.
Returns:
the DocumentIterator for the resulting search.
Throws:
DocumentException - thrown on an error.

setObject

public void setObject(int index,
                      java.lang.Object obj)
               throws java.sql.SQLException
Set the input parameter.
Overrides:
setObject in class CallableStatement
Throws:
java.sql.SQLException - thrown on invalid arguments.

setString

public void setString(int index,
                      java.lang.String str)
               throws java.sql.SQLException
Set the input parameter string.
Overrides:
setString in class CallableStatement
Throws:
java.sql.SQLException - thrown on invalid arguments.

getObject

public java.lang.Object getObject(int index)
                           throws java.sql.SQLException
Get the output parameter.
Overrides:
getObject in class CallableStatement
Throws:
java.sql.SQLException - thrown on an error.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved