wt.pds
Class QuerySpecStatementBuilder

java.lang.Object
  extended bywt.pds.BasicStatementBuilder
      extended bywt.pds.SelectStatementBuilder
          extended bywt.pds.QuerySpecStatementBuilder
All Implemented Interfaces:
Cloneable, Externalizable, Serializable, StatementBuilder
Direct Known Subclasses:
NavigateStatementBuilder

public class QuerySpecStatementBuilder
extends SelectStatementBuilder
implements Cloneable, Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private  Vector allAccessConditionBindParameters
           
private  Vector allConditionBindParameters
           
private  Vector allSingleBindParameters
           
private  Vector allTableBindParameters
           
private static String CLASSNAME
           
private  Vector conditions
           
static boolean DEBUG
           
static long EXTERNALIZATION_VERSION_UID
           
private  boolean forUpdateSet
           
private  JoinClause joinClause
           
private static DebugWriter LOG
           
protected static long OLD_FORMAT_VERSION_UID
           
protected static long OLD_SERIAL_VERSION_UID
           
private  QuerySpec querySpec
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  Vector singleBindParameters
           
 
Fields inherited from class wt.pds.SelectStatementBuilder
chunkCount, LARGE_IN_LIST_WARNING
 
Fields inherited from class wt.pds.BasicStatementBuilder
DMLGENERATOR
 
Fields inherited from interface wt.pds.StatementBuilder
CHUNKING_ENABLED, FETCH_SIZE, SQL_STATEMENTS, STATEMENT_COUNT
 
Constructor Summary
QuerySpecStatementBuilder()
           
 
Method Summary
 void appendCondition(WhereCondition a_condition)
          Appends the specified WhereCondition to the query.
 void appendJoin(JoinCondition a_joinCondition)
          Deprecated. as of R7.0, use appendCondition(WhereCondition)
 String buildEmptyAggregateSQL()
          

Supported API: false
 void buildJoinIndexSet()
          

Supported API: false
 String buildSQLStatement(Vector a_tables, Vector a_aliases, ResultBuilder a_resultBuilder, boolean a_distinct, WhereClause a_whereClause, String a_orderByClause, GroupByClause a_groupByClause, ConditionsClause a_havingClause, int a_sqlIndex, boolean a_forUpdate)
          This method builds a SQL statement.
 Object clone()
           
(package private) static List filterArrayChunkProcessors(List a_list, int a_arraySizeThreshold, List a_filtered)
          This method processes a List of ArrayChunkProcessor instances to return all instances greater than the array size threshold.
protected  List getArrayChunkProcessors(int a_arraySizeThreshold)
          This method returns a List of ArrayChunkProcessor instances for this query.
 FromClause getFromClause()
          Gets the object for the association that plays role: fromClause.
 GroupByClause getGroupByClause()
          Gets the value of the attribute: groupByClause.
 ConditionsClause getHavingClause()
          Gets the value of the attribute: havingClause.
 JoinClause getJoinClause()
          Gets the object for the association that plays role: joinClause.
 Set getJoinFromIndicies(int a_fromIndex)
           
 String getJoinString()
           
 WhereClause getJoinWhereClause(WhereClause a_whereClause, Set a_joinIndexSet)
          

Supported API: false
 OrderByClause getOrderByClause()
          Gets the value of the attribute: orderByClause.
 QuerySpec getQuerySpec()
          Gets the object for the association that plays role: querySpec.
 Vector getSingleBindParameters()
          Gets the value of the attribute: singleBindParameters; Bind parameters for a single statement (excluding join bind parameters)

Supported API: false
 Vector getStatementBindParameters(int a_sqlIndex)
          Returns a Vector of bind parameters for the specified statement.
 StatementFilter getStatementFilter(Vector[] a_fromArray)
          StatementBuilder used to generate SQL for the depth threshold query.
private  int[] getTableOrder(Vector a_tables, int[] a_joinOrder)
           
 Vector[] getTables()
          This method returns an array of Vectors.
 Vector[] getTables(FromClause a_fromClause, int offset, int length)
           
 WhereClause getWhereClause()
          Gets the value of the attribute: whereClause.
 boolean isAggregateSelect()
          

Supported API: false
 boolean isDistinct()
          Gets the value of the attribute: distinct.
 boolean isForUpdateSet()
          Gets the value of the attribute: forUpdateSet.
 boolean isQuerySpecSetLock()
          

Supported API: false
 boolean isUseBind()
          Gets the value of the attribute: useBind.
 List preBuildSQL()
          This method is used to process join search conditions, construct bind parameters for the Where, and set class view attributes.
private  boolean processJoinSet(JoinIndex joinIndex, Set joinIndiciesSet, Set joinIndexSet)
           
private  void querySpecValidate(QuerySpec a_QuerySpec)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(QuerySpecStatementBuilder thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
protected  void resetBindParameterVectors()
           
 void setForUpdateSet(boolean a_ForUpdateSet)
          Sets the value of the attribute: forUpdateSet.
 void setJoinClause(JoinClause a_JoinClause)
          Sets the object for the association that plays role: joinClause.
 void setQuerySpec(QuerySpec a_QuerySpec)
          Sets the object for the association that plays role: querySpec.
protected  void setSingleBindParameters(Vector a_SingleBindParameters)
          Sets the value of the attribute: singleBindParameters; Bind parameters for a single statement (excluding join bind parameters)

Supported API: false
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class wt.pds.SelectStatementBuilder
buildSQL, clone, getChunkProcessorCount, getChunkProcessorCount, getDepthThreshold, getTotalCount, isQueryChunkingRequired, isQueryChunkingRequired, isQueryChunkingSupported, isUnionStatement, readVersion, setDepthThreshold
 
Methods inherited from class wt.pds.BasicStatementBuilder
appendBindParameter, buildSQL, clone, getFetchSize, getSqlStatements, getStatement, getStatementCount, insertBindParameterAt, isChunkingEnabled, readVersion, setChunkingEnabled, setFetchSize, setSqlStatements
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

conditions

private Vector conditions

singleBindParameters

private Vector singleBindParameters

forUpdateSet

private transient boolean forUpdateSet

querySpec

private QuerySpec querySpec

joinClause

private JoinClause joinClause

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

OLD_SERIAL_VERSION_UID

protected static final long OLD_SERIAL_VERSION_UID
See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG

allAccessConditionBindParameters

private transient Vector allAccessConditionBindParameters

allConditionBindParameters

private transient Vector allConditionBindParameters

allTableBindParameters

private transient Vector allTableBindParameters

allSingleBindParameters

private transient Vector allSingleBindParameters
Constructor Detail

QuerySpecStatementBuilder

public QuerySpecStatementBuilder()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class SelectStatementBuilder
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class SelectStatementBuilder
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(QuerySpecStatementBuilder thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getSingleBindParameters

public Vector getSingleBindParameters()
Gets the value of the attribute: singleBindParameters; Bind parameters for a single statement (excluding join bind parameters)

Supported API: false

Returns:
Vector

setSingleBindParameters

protected void setSingleBindParameters(Vector a_SingleBindParameters)
                                throws WTPropertyVetoException
Sets the value of the attribute: singleBindParameters; Bind parameters for a single statement (excluding join bind parameters)

Supported API: false

Parameters:
a_SingleBindParameters -
Throws:
WTPropertyVetoException

isForUpdateSet

public boolean isForUpdateSet()
Gets the value of the attribute: forUpdateSet.

Supported API: false

Overrides:
isForUpdateSet in class SelectStatementBuilder
Returns:
boolean

setForUpdateSet

public void setForUpdateSet(boolean a_ForUpdateSet)
                     throws WTPropertyVetoException
Sets the value of the attribute: forUpdateSet.

Supported API: false

Overrides:
setForUpdateSet in class SelectStatementBuilder
Parameters:
a_ForUpdateSet -
Throws:
WTPropertyVetoException

getQuerySpec

public QuerySpec getQuerySpec()
Gets the object for the association that plays role: querySpec.

Supported API: false

Returns:
QuerySpec

setQuerySpec

public void setQuerySpec(QuerySpec a_QuerySpec)
                  throws WTPropertyVetoException
Sets the object for the association that plays role: querySpec.

Supported API: false

Parameters:
a_QuerySpec -
Throws:
WTPropertyVetoException

querySpecValidate

private void querySpecValidate(QuerySpec a_QuerySpec)
                        throws WTPropertyVetoException
Parameters:
a_QuerySpec -
Throws:
WTPropertyVetoException

getJoinClause

public JoinClause getJoinClause()
Gets the object for the association that plays role: joinClause.

Supported API: false

Returns:
JoinClause

setJoinClause

public void setJoinClause(JoinClause a_JoinClause)
                   throws WTPropertyVetoException
Sets the object for the association that plays role: joinClause.

Supported API: false

Parameters:
a_JoinClause -
Throws:
WTPropertyVetoException

getStatementBindParameters

public Vector getStatementBindParameters(int a_sqlIndex)
                                  throws PersistenceException
Returns a Vector of bind parameters for the specified statement.

Supported API: false

Specified by:
getStatementBindParameters in interface StatementBuilder
Specified by:
getStatementBindParameters in class BasicStatementBuilder
Parameters:
a_sqlIndex -
Returns:
Vector
Throws:
PersistenceException

appendJoin

public void appendJoin(JoinCondition a_joinCondition)
Deprecated. as of R7.0, use appendCondition(WhereCondition)

Appends the specified JoinCondition to the query.

Supported API: false

Parameters:
a_joinCondition -

appendCondition

public void appendCondition(WhereCondition a_condition)
                     throws WTException
Appends the specified WhereCondition to the query.

Supported API: false

Parameters:
a_condition - Condition to append to the query.
Throws:
WTException

getJoinWhereClause

public WhereClause getJoinWhereClause(WhereClause a_whereClause,
                                      Set a_joinIndexSet)


Supported API: false

Parameters:
a_whereClause -
a_joinIndexSet -
Returns:
WhereClause

buildJoinIndexSet

public void buildJoinIndexSet()


Supported API: false


isDistinct

public boolean isDistinct()
Gets the value of the attribute: distinct.

Supported API: false

Specified by:
isDistinct in class SelectStatementBuilder
Returns:
boolean

getWhereClause

public WhereClause getWhereClause()
Gets the value of the attribute: whereClause.

Supported API: false

Specified by:
getWhereClause in class SelectStatementBuilder
Returns:
WhereClause

getOrderByClause

public OrderByClause getOrderByClause()
                               throws WTException
Gets the value of the attribute: orderByClause.

Supported API: false

Specified by:
getOrderByClause in class SelectStatementBuilder
Returns:
OrderByClause
Throws:
WTException

getGroupByClause

public GroupByClause getGroupByClause()
                               throws WTException
Gets the value of the attribute: groupByClause.

Supported API: false

Specified by:
getGroupByClause in class SelectStatementBuilder
Returns:
GroupByClause
Throws:
WTException

isUseBind

public boolean isUseBind()
Gets the value of the attribute: useBind.

Supported API: false

Specified by:
isUseBind in class SelectStatementBuilder
Returns:
boolean

getHavingClause

public ConditionsClause getHavingClause()
                                 throws WTException
Gets the value of the attribute: havingClause.

Supported API: false

Specified by:
getHavingClause in class SelectStatementBuilder
Returns:
ConditionsClause
Throws:
WTException

getTables

public Vector[] getTables()
                   throws PersistenceException
This method returns an array of Vectors. Each element of the array corresponds to the TableExpression at the corresponding position in the FromClause. The elements are all possible combinations of concrete TableExpressions that need to be queried.

Supported API: false

Specified by:
getTables in class SelectStatementBuilder
Returns:
Vector[]
Throws:
PersistenceException

buildSQLStatement

public String buildSQLStatement(Vector a_tables,
                                Vector a_aliases,
                                ResultBuilder a_resultBuilder,
                                boolean a_distinct,
                                WhereClause a_whereClause,
                                String a_orderByClause,
                                GroupByClause a_groupByClause,
                                ConditionsClause a_havingClause,
                                int a_sqlIndex,
                                boolean a_forUpdate)
                         throws PersistenceException
This method builds a SQL statement.

Supported API: false

Specified by:
buildSQLStatement in class SelectStatementBuilder
Parameters:
a_tables - The TableExpressions for this statement.
a_aliases - The aliases corresponding to the TableExpressions for this statement.
a_resultBuilder - Result builder instance to use for constructing the statement.
a_distinct -
a_whereClause -
a_orderByClause -
a_groupByClause -
a_havingClause -
a_sqlIndex - SQL index of this statement.
a_forUpdate -
Returns:
String
Throws:
PersistenceException

getStatementFilter

public StatementFilter getStatementFilter(Vector[] a_fromArray)
                                   throws PersistenceException
StatementBuilder used to generate SQL for the depth threshold query.

Supported API: false

Specified by:
getStatementFilter in class SelectStatementBuilder
Parameters:
a_fromArray - Array of Vectors containing FromExpression instances
Returns:
StatementFilter
Throws:
PersistenceException

buildEmptyAggregateSQL

public String buildEmptyAggregateSQL()
                              throws PersistenceException


Supported API: false

Specified by:
buildEmptyAggregateSQL in class SelectStatementBuilder
Returns:
String
Throws:
PersistenceException

isAggregateSelect

public boolean isAggregateSelect()


Supported API: false

Specified by:
isAggregateSelect in class SelectStatementBuilder
Returns:
boolean

isQuerySpecSetLock

public boolean isQuerySpecSetLock()


Supported API: false

Specified by:
isQuerySpecSetLock in class SelectStatementBuilder
Returns:
boolean

preBuildSQL

public List preBuildSQL()
                 throws PersistenceException
This method is used to process join search conditions, construct bind parameters for the Where, and set class view attributes.

Supported API: false

Specified by:
preBuildSQL in class SelectStatementBuilder
Returns:
List
Throws:
PersistenceException

getFromClause

public FromClause getFromClause()
Gets the object for the association that plays role: fromClause.

Supported API: false

Specified by:
getFromClause in class SelectStatementBuilder
Returns:
FromClause

getJoinFromIndicies

public Set getJoinFromIndicies(int a_fromIndex)

getJoinString

public String getJoinString()

clone

public Object clone()

getTables

public Vector[] getTables(FromClause a_fromClause,
                          int offset,
                          int length)
                   throws PersistenceException
Throws:
PersistenceException

getArrayChunkProcessors

protected List getArrayChunkProcessors(int a_arraySizeThreshold)
                                throws WTException
This method returns a List of ArrayChunkProcessor instances for this query.

Specified by:
getArrayChunkProcessors in class SelectStatementBuilder
Throws:
WTException

filterArrayChunkProcessors

static List filterArrayChunkProcessors(List a_list,
                                       int a_arraySizeThreshold,
                                       List a_filtered)
                                throws WTException
This method processes a List of ArrayChunkProcessor instances to return all instances greater than the array size threshold.

Throws:
WTException

getTableOrder

private int[] getTableOrder(Vector a_tables,
                            int[] a_joinOrder)

processJoinSet

private boolean processJoinSet(JoinIndex joinIndex,
                               Set joinIndiciesSet,
                               Set joinIndexSet)

resetBindParameterVectors

protected void resetBindParameterVectors()
Specified by:
resetBindParameterVectors in class SelectStatementBuilder