|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.query.CompoundQuerySpec
This class provides the functionality to build a compound query statement.
Any number of components can be added to the Compound Query (Two are required for a valid compound SQL statement). A single Set Operator can be specified.
The SQL statement is built from left to right using the components with
the lowest index to the highest index. If precedence is significant,
the components with equal precedence should be added to a separate instance
and nested within another CompoundQuerySpec instance.
Supported API: true
Extendable: false
Field Summary | |
private boolean |
advancedQueryEnabled
|
private static String |
CLASSNAME
|
static long |
EXTERNALIZATION_VERSION_UID
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
private ResultBuilder |
resultBuilder
|
private ResultCursor |
resultCursor
|
(package private) static long |
serialVersionUID
|
private CompoundStatementBuilder |
statementBuilder
|
private StatementSpec |
thePrimary
|
Fields inherited from interface wt.pds.StatementSpec |
ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, AGGREGATE_SELECT, CORRELATED_CLASS_ATTRIBUTES, FETCH_SIZE, PRIMARY_CLASS, QUERY_LIMIT, RESULT_BUILDER, RESULT_CURSOR, SINGLE_RESULT_COMPATIBLE, STATEMENT_BUILDER, USE_BIND |
Constructor Summary | |
CompoundQuerySpec()
|
Method Summary | |
void |
addComponent(StatementSpec a_statementSpec)
This method adds a component statement. |
void |
appendOrderBy(OrderBy a_orderBy)
Appends an Order By expression to the compund query. |
private int |
findMinimumLimit(Vector components)
|
private StatementSpec |
findNonEmptyComponent()
|
List |
getAllComponentQuerySpecs()
|
List |
getAllComponentQuerySpecs(StatementSpec a_statementSpec,
List a_querySpecs)
|
int |
getBindParameterCount()
Supported API: false |
ArrayList |
getChunkableComponents()
Return a list of components which contains a larget value list greater than a configurable limit. |
Vector |
getComponents()
Gets the object for the association that plays role: components. |
List |
getCorrelatedClassAttributes()
Gets the value of the attribute: correlatedClassAttributes. |
int |
getFetchSize()
Gets the value of the attribute: fetchSize; A hint as to the number of rows that should be fetched from the database when more rows are needed. |
private StatementSpec |
getPrimary()
|
Class |
getPrimaryClass()
Gets the value of the attribute: primaryClass; Primary class for the query. |
int |
getQueryLimit()
Gets the value of the attribute: queryLimit. |
ResultBuilder |
getResultBuilder()
Gets the object for the association that plays role: resultBuilder. |
ResultCursor |
getResultCursor()
Gets the object for the association that plays role: resultCursor. |
SetOperator |
getSetOperator()
Gets the object for the association that plays role: setOperator. |
StatementBuilder |
getStatementBuilder()
Gets the object for the association that plays role: statementBuilder. |
boolean |
isAdvancedQuery()
Gets the value of the attribute: advancedQuery; Indicates if the statement uses advanced query capabilities. |
boolean |
isAdvancedQueryEnabled()
Gets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled. |
boolean |
isAggregateSelect()
Gets the value of the attribute: aggregateSelect; Indicates if the statement has aggregate select . |
boolean |
isIncludeNestedParantheses()
Gets the value of the attribute: includeNestedParantheses; Indicates if parantheses should be included for nested statements. |
boolean |
isQueryChunkSupported()
Indicate if this compound queryspec can support chunking Supported API: false |
boolean |
isSingleResultCompatible()
Gets the value of the attribute: singleResultCompatible; Indicates if the query result should be returned as a single result (for backward compatibility) Supported API: false |
boolean |
isUseBind()
Gets the value of the attribute: useBind; Indicates if bind parameters should be used for this statement. |
boolean |
isUseComponentOrderBy()
Gets the value of the attribute: useComponentOrderBy; Indicates if the order by clause should be taken from the first component of the compound statement. |
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(CompoundQuerySpec thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
private void |
resultCursorValidate(ResultCursor a_ResultCursor)
|
void |
setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
Sets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled. |
void |
setBindParameterAt(Object a_value,
int a_index)
Supported API: false |
void |
setComponents(Vector a_Components)
Sets the object for the association that plays role: components. |
void |
setFetchSize(int a_FetchSize)
Sets the value of the attribute: fetchSize; A hint as to the number of rows that should be fetched from the database when more rows are needed. |
void |
setIncludeNestedParantheses(boolean a_IncludeNestedParantheses)
Sets the value of the attribute: includeNestedParantheses; Indicates if parantheses should be included for nested statements. |
void |
setLocale(Locale a_locale)
Set the client locale. |
void |
setResultCursor(ResultCursor a_ResultCursor)
Sets the object for the association that plays role: resultCursor. |
void |
setSetOperator(SetOperator a_SetOperator)
Sets the object for the association that plays role: setOperator. |
void |
setUseBind(boolean a_UseBind)
Sets the value of the attribute: useBind; Indicates if bind parameters should be used for this statement. |
void |
setUseComponentOrderBy(boolean a_UseComponentOrderBy)
Sets the value of the attribute: useComponentOrderBy; Indicates if the order by clause should be taken from the first component of the compound statement. |
String |
toString()
|
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private transient boolean advancedQueryEnabled
private ResultCursor resultCursor
private CompoundStatementBuilder statementBuilder
private ResultBuilder resultBuilder
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private transient StatementSpec thePrimary
Constructor Detail |
public CompoundQuerySpec()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(CompoundQuerySpec thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public boolean isAdvancedQueryEnabled()
isAdvancedQueryEnabled
in interface StatementSpec
public void setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
setAdvancedQueryEnabled
in interface StatementSpec
a_AdvancedQueryEnabled
- public boolean isUseComponentOrderBy()
public void setUseComponentOrderBy(boolean a_UseComponentOrderBy)
a_UseComponentOrderBy
- public Vector getComponents()
public void setComponents(Vector a_Components) throws WTPropertyVetoException
a_Components
-
WTPropertyVetoException
public ResultCursor getResultCursor()
getResultCursor
in interface StatementSpec
public void setResultCursor(ResultCursor a_ResultCursor) throws WTPropertyVetoException
a_ResultCursor
-
WTPropertyVetoException
private void resultCursorValidate(ResultCursor a_ResultCursor) throws WTPropertyVetoException
a_ResultCursor
-
WTPropertyVetoException
public SetOperator getSetOperator()
public void setSetOperator(SetOperator a_SetOperator) throws WTPropertyVetoException
a_SetOperator
-
WTPropertyVetoException
public StatementBuilder getStatementBuilder()
getStatementBuilder
in interface StatementSpec
public ResultBuilder getResultBuilder()
getResultBuilder
in interface StatementSpec
public void addComponent(StatementSpec a_statementSpec)
a_statementSpec
- Component statement to addpublic void appendOrderBy(OrderBy a_orderBy) throws QueryException
a_orderBy
- OrderBy object to append
QueryException
public boolean isQueryChunkSupported()
public ArrayList getChunkableComponents() throws WTException
WTException
public Class getPrimaryClass()
getPrimaryClass
in interface StatementSpec
public boolean isSingleResultCompatible()
isSingleResultCompatible
in interface StatementSpec
public int getQueryLimit()
getQueryLimit
in interface StatementSpec
public boolean isAdvancedQuery() throws WTException
isAdvancedQuery
in interface StatementSpec
WTException
public boolean isAggregateSelect()
isAggregateSelect
in interface StatementSpec
public List getCorrelatedClassAttributes()
getCorrelatedClassAttributes
in interface StatementSpec
public boolean isUseBind()
isUseBind
in interface StatementSpec
public void setUseBind(boolean a_UseBind) throws WTPropertyVetoException
setUseBind
in interface StatementSpec
a_UseBind
-
WTPropertyVetoException
public int getFetchSize()
getFetchSize
in interface StatementSpec
public void setFetchSize(int a_FetchSize) throws WTPropertyVetoException
setFetchSize
in interface StatementSpec
a_FetchSize
-
WTPropertyVetoException
public void setLocale(Locale a_locale) throws WTException
setLocale
in interface StatementSpec
a_locale
-
WTException
public void setBindParameterAt(Object a_value, int a_index)
setBindParameterAt
in interface StatementSpec
a_value
- a_index
- public int getBindParameterCount()
getBindParameterCount
in interface StatementSpec
public boolean isIncludeNestedParantheses()
public void setIncludeNestedParantheses(boolean a_IncludeNestedParantheses)
a_IncludeNestedParantheses
- private StatementSpec findNonEmptyComponent() throws WTException
WTException
private StatementSpec getPrimary()
private int findMinimumLimit(Vector components)
public String toString()
public List getAllComponentQuerySpecs()
public List getAllComponentQuerySpecs(StatementSpec a_statementSpec, List a_querySpecs)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |