wt.query
Class ExistsExpression

java.lang.Object
  extended bywt.query.ExistsExpression
All Implemented Interfaces:
Externalizable, Serializable, WhereExpression

public class ExistsExpression
extends Object
implements WhereExpression, Externalizable

This class represents an EXISTS expression in a WHERE clause. A StatementSpec instance is used for the subselect.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean advancedQueryEnabled
           
private  int bindParameterCount
           
private  int bindParameterOffset
           
private static String CLASSNAME
           
private static DMLGenerator dmlGenerator
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  StatementSpec subSelect
           
 
Fields inherited from interface wt.query.WhereExpression
ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, BIND_PARAMETER, CORRELATED_CLASS_ATTRIBUTES, FROM_COUNT, FROM_INDICIES
 
Constructor Summary
ExistsExpression()
          

Supported API: false
ExistsExpression(StatementSpec a_subSelect)
          

Supported API: true
 
Method Summary
 Object getBindParameter()
          Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).
 Object getBindParameterFrom(Vector a_singleBindParameter)
          

Supported API: false
 List getClassAttributes()
          

Supported API: false
 List getCorrelatedClassAttributes()
          Gets the value of the attribute: correlatedClassAttributes.
private  DMLGenerator getDMLGenerator()
           
 String getExpression(boolean a_useBind, Vector a_tableInfos, Vector a_aliases)
          Return string representation of this expression.
 int getFromCount()
          Gets the value of the attribute: fromCount; Number of FromClause TableExpressions/Aliases that this expression requires.
 int[] getFromIndicies()
          Gets the value of the attribute: fromIndicies; Indicies for all current expressions relative to a FromClause that will be used for validating and setting aliases when this compostie expression is appended to a statement.
 WhereExpression getJoinConditions(JoinIndex a_joinIndex)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(Set a_joinIndexSet)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(String a_alias)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(String a_alias, boolean a_removed)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(String a_alias, int a_outerNonJoinFromIndex, boolean a_removed)
          This method is to return the join search condition.
 Set getJoinIndex()
          

Supported API: false
 void handleCorrelatedAttributes(Vector a_tableInfos, Vector a_aliases)
          

Supported API: false
 boolean isAdvancedQuery()
          Gets the value of the attribute: advancedQuery; Indicates if the expression uses advanced query capabilities.
 boolean isAdvancedQueryEnabled()
          Gets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled.
 boolean isAllJoinConditions(JoinIndex a_joinIndex)
          

Supported API: false
 boolean isAllJoinConditions(Set a_joinIndexSet)
          

Supported API: false
 boolean isAllJoinConditions(String a_alias)
          

Supported API: false
 boolean isAllJoinConditions(String a_alias, boolean a_removed)
          

Supported API: false
 boolean isAllOuterNonJoinConditions()
          

Supported API: false
 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(ExistsExpression thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
          Sets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled.
 int setAliases(String[] a_aliases, int a_offset)
          This method sets the aliases for components of the expression.
 int setBindParameterIndicies(int a_offset)
          

Supported API: false
 int setFromIndicies(int[] a_fromIndicies, int a_offset)
          This method sets the From clause indicies for components of the expression.
 int validate(TableExpression[] a_fromTables, int a_offset)
          This method validates the expression against the FROM clause.
 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, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

bindParameterOffset

private int bindParameterOffset

bindParameterCount

private int bindParameterCount

subSelect

private StatementSpec subSelect

advancedQueryEnabled

private transient boolean advancedQueryEnabled

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

dmlGenerator

private static DMLGenerator dmlGenerator
Constructor Detail

ExistsExpression

public ExistsExpression()


Supported API: false


ExistsExpression

public ExistsExpression(StatementSpec a_subSelect)


Supported API: true

Parameters:
a_subSelect - Specifies instance to use for sub-select.
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
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
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ExistsExpression 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

getBindParameter

public Object getBindParameter()
                        throws WTException
Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).

Supported API: false

Specified by:
getBindParameter in interface WhereExpression
Returns:
Object
Throws:
WTException

getFromCount

public int getFromCount()
Gets the value of the attribute: fromCount; Number of FromClause TableExpressions/Aliases that this expression requires.

Supported API: false

Specified by:
getFromCount in interface WhereExpression
Returns:
int

getFromIndicies

public int[] getFromIndicies()
Gets the value of the attribute: fromIndicies; Indicies for all current expressions relative to a FromClause that will be used for validating and setting aliases when this compostie expression is appended to a statement.

Supported API: true

Specified by:
getFromIndicies in interface WhereExpression
Returns:
int[]

isAdvancedQuery

public boolean isAdvancedQuery()
                        throws WTException
Gets the value of the attribute: advancedQuery; Indicates if the expression uses advanced query capabilities.

Supported API: false

Specified by:
isAdvancedQuery in interface WhereExpression
Returns:
boolean
Throws:
WTException

getCorrelatedClassAttributes

public List getCorrelatedClassAttributes()
Gets the value of the attribute: correlatedClassAttributes.

Supported API: false

Specified by:
getCorrelatedClassAttributes in interface WhereExpression
Returns:
List

isAdvancedQueryEnabled

public boolean isAdvancedQueryEnabled()
Gets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled.

Supported API: false

Specified by:
isAdvancedQueryEnabled in interface WhereExpression
Returns:
boolean

setAdvancedQueryEnabled

public void setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
Sets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled.

Supported API: false

Specified by:
setAdvancedQueryEnabled in interface WhereExpression
Parameters:
a_AdvancedQueryEnabled -

validate

public int validate(TableExpression[] a_fromTables,
                    int a_offset)
             throws QueryException
This method validates the expression against the FROM clause.

Supported API: false

Specified by:
validate in interface WhereExpression
Parameters:
a_fromTables - TableExpressions to validate against.
a_offset - Offset index into the TableExpression array for the next valid TableExpression
Returns:
number of TableExpressions validated
Throws:
QueryException

setAliases

public int setAliases(String[] a_aliases,
                      int a_offset)
               throws QueryException
This method sets the aliases for components of the expression.

Supported API: false

Specified by:
setAliases in interface WhereExpression
Parameters:
a_aliases - Aliases to set.
a_offset - Offset index into the alias array for the next valid alias
Returns:
number of aliases used
Throws:
QueryException

getExpression

public String getExpression(boolean a_useBind,
                            Vector a_tableInfos,
                            Vector a_aliases)
                     throws QueryException
Return string representation of this expression.

Supported API: false

Specified by:
getExpression in interface WhereExpression
Parameters:
a_useBind - Indicates if bind parameters should be used.
a_tableInfos -
a_aliases -
Returns:
String
Throws:
QueryException

setFromIndicies

public int setFromIndicies(int[] a_fromIndicies,
                           int a_offset)
This method sets the From clause indicies for components of the expression.

Supported API: true

Specified by:
setFromIndicies in interface WhereExpression
Parameters:
a_fromIndicies - From indicies to set.
a_offset - Offset index into the From indicies array for the next valid From index
Returns:
number of indicies used

getClassAttributes

public List getClassAttributes()


Supported API: false

Specified by:
getClassAttributes in interface WhereExpression
Returns:
List

getJoinConditions

public WhereExpression getJoinConditions(String a_alias)
                                  throws QueryException
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_alias -
Returns:
WhereExpression
Throws:
QueryException

isAllJoinConditions

public boolean isAllJoinConditions(String a_alias)
                            throws QueryException


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_alias -
Returns:
boolean
Throws:
QueryException

getJoinIndex

public Set getJoinIndex()


Supported API: false

Specified by:
getJoinIndex in interface WhereExpression
Returns:
Set

getJoinConditions

public WhereExpression getJoinConditions(JoinIndex a_joinIndex)
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_joinIndex -
Returns:
WhereExpression

isAllOuterNonJoinConditions

public boolean isAllOuterNonJoinConditions()


Supported API: false

Specified by:
isAllOuterNonJoinConditions in interface WhereExpression
Returns:
boolean

getBindParameterFrom

public Object getBindParameterFrom(Vector a_singleBindParameter)


Supported API: false

Specified by:
getBindParameterFrom in interface WhereExpression
Parameters:
a_singleBindParameter -
Returns:
Object

setBindParameterIndicies

public int setBindParameterIndicies(int a_offset)


Supported API: false

Specified by:
setBindParameterIndicies in interface WhereExpression
Parameters:
a_offset -
Returns:
int

getJoinConditions

public WhereExpression getJoinConditions(Set a_joinIndexSet)
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_joinIndexSet -
Returns:
WhereExpression

isAllJoinConditions

public boolean isAllJoinConditions(Set a_joinIndexSet)


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_joinIndexSet -
Returns:
boolean

isAllJoinConditions

public boolean isAllJoinConditions(JoinIndex a_joinIndex)


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_joinIndex -
Returns:
boolean

getJoinConditions

public WhereExpression getJoinConditions(String a_alias,
                                         boolean a_removed)
                                  throws QueryException
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_alias -
a_removed -
Returns:
WhereExpression
Throws:
QueryException

isAllJoinConditions

public boolean isAllJoinConditions(String a_alias,
                                   boolean a_removed)
                            throws QueryException


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_alias -
a_removed -
Returns:
boolean
Throws:
QueryException

getJoinConditions

public WhereExpression getJoinConditions(String a_alias,
                                         int a_outerNonJoinFromIndex,
                                         boolean a_removed)
                                  throws QueryException
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_alias -
a_outerNonJoinFromIndex -
a_removed -
Returns:
WhereExpression
Throws:
QueryException

handleCorrelatedAttributes

public void handleCorrelatedAttributes(Vector a_tableInfos,
                                       Vector a_aliases)


Supported API: false

Specified by:
handleCorrelatedAttributes in interface WhereExpression
Parameters:
a_tableInfos -
a_aliases -

getDMLGenerator

private DMLGenerator getDMLGenerator()