|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.mdm.index.query.QueryPipeLine
Splits the QueryObject into multiple QueryObjects and invokes QueryManager to execute and return back QMIterator QueryPipeLine executes the query in these stages. • 1: create QueryObject to select only primary keys for primary object. Invoke QueryManager.execute() to get ids. • 2: Divide the ids received from step 1 into multiples of fetchsize and create Queryobjects based on the original queryobject received in step 1. Add IN condition containing fetch ids to the original queryobject and invoke QueryManager.executeAssemble. It replaces the AssemblerEngine in QMIterator received from QueryManager.execute by itself. Acting as AssemblerEngine, QueryPipeLine delegates its AssmblerEngine methods invocations to the original AssemblerEngine, specified in the QueryObject. So QueryPipeLine acts as lazy query executer that executes more queryobjects when set of data returned by previous QueryObject is exhausted.
Constructor Summary | |
(package private) |
QueryPipeLine()
|
Method Summary | |
java.lang.Object |
clone()
clones the AssemblerEngine |
void |
close()
This will close the JDBC resultsets. |
(package private) QMIterator |
executeAssemble(QueryObject qobject)
This method will execute the query(s) specified in QueryObject and also use FactoryEngine for creating composite objects. |
(package private) AssemblerEngine |
getOriginalAssemblerEngine(QMIterator iterator)
An Iterator's assemblerEngine may be already susbstituted by QueryPipeLine(in case we get the QMIterator from QueryObjectCache). |
boolean |
hasNext()
returns true or false if next object can be retrieved |
void |
initCompile(SQLDescriptor[] sqlDesc,
AssembleDescriptor assDesc)
|
void |
initRun(java.sql.Connection con,
java.sql.ResultSet[] resultSets,
java.sql.Statement[] statements,
int maxRows)
|
void |
initRun(java.sql.Connection con,
java.sql.ResultSet[] resultSets,
java.sql.Statement[] statements,
int maxRows,
boolean closeDbConnection)
This method initializes the data structures that are used during run time and can be writeable. |
java.lang.Object |
next()
This will retrieve next composite object constructed by AssemblerEngine. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
QueryPipeLine() throws CreateException
Method Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface AssemblerEngine
java.lang.CloneNotSupportedException
- CloneNotSupportedExceptionpublic void close() throws QMException
close
in interface AssemblerEngine
QMException
- QMExceptionQMIterator executeAssemble(QueryObject qobject) throws QMException
qobject
- QueryObject that contains description of query
QMException
- QMExceptionAssemblerEngine getOriginalAssemblerEngine(QMIterator iterator)
iterator
-
public boolean hasNext() throws QMException
hasNext
in interface AssemblerEngine
QMException
- QMExceptionpublic void initCompile(SQLDescriptor[] sqlDesc, AssembleDescriptor assDesc) throws QMException
AssemblerEngine
initCompile
in interface AssemblerEngine
sqlDesc
- SQLDescriptor[] that contains SQL statements and their
meta data to be used for initialization.assDesc
- AssembleDescriptor
QMException
- QMExceptionpublic void initRun(java.sql.Connection con, java.sql.ResultSet[] resultSets, java.sql.Statement[] statements, int maxRows) throws QMException
AssemblerEngine
initRun
in interface AssemblerEngine
con
- ConnectionresultSets
- ResultSet[]statements
- Statement[]
QMException
- QMExceptionpublic void initRun(java.sql.Connection con, java.sql.ResultSet[] resultSets, java.sql.Statement[] statements, int maxRows, boolean closeDbConnection) throws QMException
initRun
in interface AssemblerEngine
con
- ConnectionresultSets
- ResultSet[]statements
- Statement[]maxRows
- maximum number of rowscloseDbConnection
- set to true if the database connection is to be
closed by the AssemblerEngine, false if some other calling class is to close
the database connection instead.
QMException
- QMExceptionpublic java.lang.Object next() throws QMException
next
in interface AssemblerEngine
QMException
- QMException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sun Microsystems, Inc.