wt.query
Class AbstractClassTableExpression

java.lang.Object
  extended bywt.query.AbstractClassTableExpression
All Implemented Interfaces:
Cloneable, Externalizable, PageableTableExpression, Serializable, TableExpression
Direct Known Subclasses:
ClassTableExpression, ClassViewExpression

public abstract class AbstractClassTableExpression
extends Object
implements TableExpression, PageableTableExpression, Externalizable

This class represents the table associated with a target class.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean accessControlRequired
           
private  boolean advancedQueryEnabled
           
private static String CLASSNAME
           
private  Vector columns
           
static boolean DEBUG
           
private  boolean descendantsIncluded
           
private  boolean emptyTableOptimzationEnabled
           
private  List excludedDescendants
           
static long EXTERNALIZATION_VERSION_UID
           
private  List includedInterfaces
           
private static DebugWriter LOG
           
protected static long OLD_FORMAT_VERSION_UID
           
private  List orderAttributeList
           
private  boolean outerJoin
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  Class tableClass
           
private static boolean VERBOSE
           
 
Fields inherited from interface wt.query.TableExpression
ACCESS_CONTROL_REQUIRED, ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, BIND_PARAMETER, DESCENDANTS_INCLUDED, TABLE_CLASS
 
Constructor Summary
AbstractClassTableExpression()
          

Supported API: false
AbstractClassTableExpression(Class a_class)
          

Supported API: false
 
Method Summary
abstract  void appendClassAttribute(ClassAttribute a_classAttribute)
          

Supported API: false
 void appendSnapshotSelectId(QuerySpec a_snapshotSpec, int a_fromIndex)
          This method appends an paging ID item to the specified snapshot query.
 void appendSnapshotSelectName(QuerySpec a_snapshotSpec, int a_fromIndex)
          This method appends an paging name item to the specified snapshot query.
protected  JoinClause buildJoinCondition(Class a_tableClass, String a_alias, HashMap a_map, boolean a_fullPersistable)
           
protected  String buildJoinCondition(String a_alias, Class a_tableClass, HashMap a_map, boolean a_fullPersistable)
           
 Object clone()
          Returns a deep copy of this object.
 void columnsReset()
          

Supported API: false
static Vector filterEmptyTables(Vector a_classInfos)
           
protected  boolean getAccessControlRequired(Vector a_classInfos)
           
abstract  Object getAppendedJoinConditionsBindParamter(String a_alias, Vector a_singleBindParameter, int a_outerNonJoinFromIndex, boolean a_fullPersistable)
          

Supported API: false
private  Vector getAutoNavigateClasses(Class a_class)
           
private  Vector getAutoNavigateMap(Vector a_vector)
           
 int[] getAutoNaviTableOrder(Class a_tableClass)
          

Supported API: false
 Object getBindParameter()
          Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).
static boolean getClassAccessControlRequired(Vector a_classInfos)
           
protected  Vector getClassInfos(boolean a_descendant)
           
abstract  ItemBuilder getColumnAccessItemBuilder(Class a_class, int a_fromIndex)
          

Supported API: false
 Vector getColumns()
          Gets the value of the attribute: columns.
 List getExcludedDescendants()
          Gets the value of the attribute: excludedDescendants; List of classes that are excluded when processing that target class's descendants.
abstract  String getExpression(AttributeMapInfo a_attributeMapInfo, AccessControllerProcessor a_accessControllerProcessor, String a_alias, int a_outerJoinType, boolean a_fullPersistableTable, boolean a_useBind)
          Return string representation of this expression.
abstract  JoinClause getJoinCondition(String a_alias, boolean a_fullPersistable, Class a_tableClass)
          

Supported API: false
abstract  String getJoinCondition(String a_alias, Class a_tableClass, boolean a_fullPersistable)
          

Supported API: false
 List getOrderAttributeList()
          Gets the value of the attribute: orderAttributeList; List of class attributes which are used to determine the order of class tables for the auto-navigate class.
abstract  int getReferencedViewClassCount()
          

Supported API: false
 Class getTableClass()
          Gets the value of the attribute: tableClass; The associated class for the table expression.
protected  HashMap getTableReferenceMap(Class tableClass, String a_alias, ClassInfo[] a_classes, String[] a_tableAliases, Vector a_columns, boolean a_fullPersistableTable)
           
abstract  Vector getTables()
          Returns a Vector of TableExpressions corresponding to this TableExpression.
 Class[] getValidClasses()
          Returns Class[] for tableClass and included Interfaces.
 boolean isAccessControlled()
          Indicates if the TableExpression involves AccessControlled classes.
 boolean isAccessControlRequired()
          Gets the value of the attribute: accessControlRequired; Indicates if Access Control is required for SELECT columns that reference this TableExpression in the FROM clause.
 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.
abstract  boolean isAutoNavigate()
          

Supported API: false
 boolean isDescendantsIncluded()
          Gets the value of the attribute: descendantsIncluded; Indicates if descendant need to be included this TableExpression in the FROM clause.
 boolean isEmptyTableOptimzationEnabled()
          Gets the value of the attribute: emptyTableOptimzationEnabled.
 boolean isOuterJoin()
          Gets the value of the attribute: outerJoin.
abstract  boolean isUseViewTableAlias()
          

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(AbstractClassTableExpression thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setAccessControlRequired(boolean a_AccessControlRequired)
          Sets the value of the attribute: accessControlRequired; Indicates if Access Control is required for SELECT columns that reference this TableExpression in the FROM clause.
 void setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
          Sets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled.
abstract  void setAppendedJoinConditions(WhereClause a_whereClause, WhereExpression a_whereExpression)
          

Supported API: false
abstract  Object setAppendedJoinConditions(WhereClause a_whereClause, WhereExpression a_whereExpression, String a_alias, Vector a_singleBindParameter, int a_outerNonJoinFromIndex, boolean a_fullPersistable, boolean a_useBind)
          

Supported API: false
 void setColumns(Vector a_Columns)
          Sets the value of the attribute: columns.
 void setDescendantsIncluded(boolean a_DescendantsIncluded)
          Sets the value of the attribute: descendantsIncluded; Indicates if descendant need to be included this TableExpression in the FROM clause.
 void setEmptyTableOptimzationEnabled(boolean a_EmptyTableOptimzationEnabled)
          Sets the value of the attribute: emptyTableOptimzationEnabled.
 void setExcludedDescendants(List a_ExcludedDescendants)
          Sets the value of the attribute: excludedDescendants; List of classes that are excluded when processing that target class's descendants.
 void setIncludedInterfaces(List a_includedInterfaces)
          

Supported API: true
 void setOrderAttributeList(List a_OrderAttributeList)
          Sets the value of the attribute: orderAttributeList; List of class attributes which are used to determine the order of class tables for the auto-navigate class.
 void setOuterJoin(boolean a_OuterJoin)
          Sets the value of the attribute: outerJoin.
 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

tableClass

private Class tableClass

accessControlRequired

private transient boolean accessControlRequired

outerJoin

private boolean outerJoin

descendantsIncluded

private boolean descendantsIncluded

excludedDescendants

private List excludedDescendants

includedInterfaces

private List includedInterfaces

emptyTableOptimzationEnabled

private boolean emptyTableOptimzationEnabled

columns

private Vector columns

orderAttributeList

private List orderAttributeList

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

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG

VERBOSE

private static boolean VERBOSE
Constructor Detail

AbstractClassTableExpression

public AbstractClassTableExpression()


Supported API: false


AbstractClassTableExpression

public AbstractClassTableExpression(Class a_class)


Supported API: false

Parameters:
a_class -
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(AbstractClassTableExpression 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

getTableClass

public Class getTableClass()
Gets the value of the attribute: tableClass; The associated class for the table expression.

Supported API: false

Specified by:
getTableClass in interface TableExpression
Returns:
Class

isAccessControlRequired

public boolean isAccessControlRequired()
Gets the value of the attribute: accessControlRequired; Indicates if Access Control is required for SELECT columns that reference this TableExpression in the FROM clause.

Supported API: false

Specified by:
isAccessControlRequired in interface TableExpression
Returns:
boolean

setAccessControlRequired

public void setAccessControlRequired(boolean a_AccessControlRequired)
Sets the value of the attribute: accessControlRequired; Indicates if Access Control is required for SELECT columns that reference this TableExpression in the FROM clause.

Supported API: false

Specified by:
setAccessControlRequired in interface TableExpression
Parameters:
a_AccessControlRequired -

isOuterJoin

public boolean isOuterJoin()
Gets the value of the attribute: outerJoin.

Supported API: false

Returns:
boolean

setOuterJoin

public void setOuterJoin(boolean a_OuterJoin)
                  throws WTPropertyVetoException
Sets the value of the attribute: outerJoin.

Supported API: false

Parameters:
a_OuterJoin -
Throws:
WTPropertyVetoException

isDescendantsIncluded

public boolean isDescendantsIncluded()
Gets the value of the attribute: descendantsIncluded; Indicates if descendant need to be included this TableExpression in the FROM clause.

Supported API: true

Specified by:
isDescendantsIncluded in interface TableExpression
Returns:
boolean

setDescendantsIncluded

public void setDescendantsIncluded(boolean a_DescendantsIncluded)
Sets the value of the attribute: descendantsIncluded; Indicates if descendant need to be included this TableExpression in the FROM clause.

Supported API: true

Specified by:
setDescendantsIncluded in interface TableExpression
Parameters:
a_DescendantsIncluded -

getExcludedDescendants

public List getExcludedDescendants()
Gets the value of the attribute: excludedDescendants; List of classes that are excluded when processing that target class's descendants.

Supported API: true

Returns:
List

setExcludedDescendants

public void setExcludedDescendants(List a_ExcludedDescendants)
                            throws WTPropertyVetoException
Sets the value of the attribute: excludedDescendants; List of classes that are excluded when processing that target class's descendants.

Supported API: true

Parameters:
a_ExcludedDescendants -
Throws:
WTPropertyVetoException

isEmptyTableOptimzationEnabled

public boolean isEmptyTableOptimzationEnabled()
Gets the value of the attribute: emptyTableOptimzationEnabled.

Supported API: false

Returns:
boolean

setEmptyTableOptimzationEnabled

public void setEmptyTableOptimzationEnabled(boolean a_EmptyTableOptimzationEnabled)
                                     throws WTPropertyVetoException
Sets the value of the attribute: emptyTableOptimzationEnabled.

Supported API: false

Parameters:
a_EmptyTableOptimzationEnabled -
Throws:
WTPropertyVetoException

getColumns

public Vector getColumns()
Gets the value of the attribute: columns.

Supported API: false

Returns:
Vector

setColumns

public void setColumns(Vector a_Columns)
                throws WTPropertyVetoException
Sets the value of the attribute: columns.

Supported API: false

Parameters:
a_Columns -
Throws:
WTPropertyVetoException

getOrderAttributeList

public List getOrderAttributeList()
Gets the value of the attribute: orderAttributeList; List of class attributes which are used to determine the order of class tables for the auto-navigate class.

Supported API: false

Returns:
List

setOrderAttributeList

public void setOrderAttributeList(List a_OrderAttributeList)
                           throws WTPropertyVetoException
Sets the value of the attribute: orderAttributeList; List of class attributes which are used to determine the order of class tables for the auto-navigate class.

Supported API: false

Parameters:
a_OrderAttributeList -
Throws:
WTPropertyVetoException

getTables

public abstract Vector getTables()
                          throws QueryException
Returns a Vector of TableExpressions corresponding to this TableExpression.

Supported API: false

Specified by:
getTables in interface TableExpression
Returns:
Vector
Throws:
QueryException

getExpression

public abstract String getExpression(AttributeMapInfo a_attributeMapInfo,
                                     AccessControllerProcessor a_accessControllerProcessor,
                                     String a_alias,
                                     int a_outerJoinType,
                                     boolean a_fullPersistableTable,
                                     boolean a_useBind)
                              throws WTException
Return string representation of this expression.

Supported API: false

Specified by:
getExpression in interface TableExpression
Parameters:
a_attributeMapInfo - Attribute information to use for building the expression
a_accessControllerProcessor - AccessContoller to use for building the expression
a_alias -
a_outerJoinType -
a_fullPersistableTable -
a_useBind -
Returns:
String
Throws:
WTException

isAccessControlled

public boolean isAccessControlled()
                           throws WTException
Indicates if the TableExpression involves AccessControlled classes.

Supported API: false

Specified by:
isAccessControlled in interface TableExpression
Returns:
boolean
Throws:
WTException

isAutoNavigate

public abstract boolean isAutoNavigate()
                                throws WTException


Supported API: false

Specified by:
isAutoNavigate in interface TableExpression
Returns:
boolean
Throws:
WTException

getColumnAccessItemBuilder

public abstract ItemBuilder getColumnAccessItemBuilder(Class a_class,
                                                       int a_fromIndex)
                                                throws PersistenceException


Supported API: false

Specified by:
getColumnAccessItemBuilder in interface TableExpression
Parameters:
a_class -
a_fromIndex -
Returns:
ItemBuilder
Throws:
PersistenceException

appendClassAttribute

public abstract void appendClassAttribute(ClassAttribute a_classAttribute)


Supported API: false

Specified by:
appendClassAttribute in interface TableExpression
Parameters:
a_classAttribute -

setIncludedInterfaces

public void setIncludedInterfaces(List a_includedInterfaces)


Supported API: true

Parameters:
a_includedInterfaces - A list containing element of Class which is used to specify the query only against their descendant concrete classes.

getValidClasses

public Class[] getValidClasses()
                        throws WTException
Returns Class[] for tableClass and included Interfaces.

Supported API: false

Specified by:
getValidClasses in interface TableExpression
Returns:
Class[]
Throws:
WTException

getAutoNaviTableOrder

public int[] getAutoNaviTableOrder(Class a_tableClass)
                            throws WTException,
                                   PersistenceException,
                                   WTIntrospectionException


Supported API: false

Parameters:
a_tableClass -
Returns:
int[]
Throws:
WTException
PersistenceException
WTIntrospectionException

getJoinCondition

public abstract JoinClause getJoinCondition(String a_alias,
                                            boolean a_fullPersistable,
                                            Class a_tableClass)
                                     throws WTException


Supported API: false

Specified by:
getJoinCondition in interface TableExpression
Parameters:
a_alias -
a_fullPersistable -
a_tableClass -
Returns:
JoinClause
Throws:
WTException

getJoinCondition

public abstract String getJoinCondition(String a_alias,
                                        Class a_tableClass,
                                        boolean a_fullPersistable)
                                 throws WTException


Supported API: false

Specified by:
getJoinCondition in interface TableExpression
Parameters:
a_alias -
a_tableClass -
a_fullPersistable -
Returns:
String
Throws:
WTException

setAppendedJoinConditions

public abstract void setAppendedJoinConditions(WhereClause a_whereClause,
                                               WhereExpression a_whereExpression)


Supported API: false

Parameters:
a_whereClause -
a_whereExpression -

getAppendedJoinConditionsBindParamter

public abstract Object getAppendedJoinConditionsBindParamter(String a_alias,
                                                             Vector a_singleBindParameter,
                                                             int a_outerNonJoinFromIndex,
                                                             boolean a_fullPersistable)
                                                      throws QueryException


Supported API: false

Parameters:
a_alias -
a_singleBindParameter -
a_outerNonJoinFromIndex -
a_fullPersistable -
Returns:
Object
Throws:
QueryException

columnsReset

public void columnsReset()


Supported API: false

Specified by:
columnsReset in interface TableExpression

getReferencedViewClassCount

public abstract int getReferencedViewClassCount()


Supported API: false

Returns:
int

setAppendedJoinConditions

public abstract Object setAppendedJoinConditions(WhereClause a_whereClause,
                                                 WhereExpression a_whereExpression,
                                                 String a_alias,
                                                 Vector a_singleBindParameter,
                                                 int a_outerNonJoinFromIndex,
                                                 boolean a_fullPersistable,
                                                 boolean a_useBind)
                                          throws QueryException


Supported API: false

Parameters:
a_whereClause -
a_whereExpression -
a_alias -
a_singleBindParameter -
a_outerNonJoinFromIndex -
a_fullPersistable -
a_useBind -
Returns:
Object
Throws:
QueryException

isUseViewTableAlias

public abstract boolean isUseViewTableAlias()


Supported API: false

Specified by:
isUseViewTableAlias in interface TableExpression
Returns:
boolean

appendSnapshotSelectId

public void appendSnapshotSelectId(QuerySpec a_snapshotSpec,
                                   int a_fromIndex)
                            throws WTException
This method appends an paging ID item to the specified snapshot query.

Supported API: false

Specified by:
appendSnapshotSelectId in interface PageableTableExpression
Parameters:
a_snapshotSpec - The snapshot QuerySpec to append to.
a_fromIndex - The fromIndex of this TableExpression in the snapshot QuerySpec.
Throws:
WTException

appendSnapshotSelectName

public void appendSnapshotSelectName(QuerySpec a_snapshotSpec,
                                     int a_fromIndex)
                              throws WTException
This method appends an paging name item to the specified snapshot query.

Supported API: false

Specified by:
appendSnapshotSelectName in interface PageableTableExpression
Parameters:
a_snapshotSpec - The snapshot QuerySpec to append to.
a_fromIndex - The fromIndex of this TableExpression in the snapshot QuerySpec.
Throws:
WTException

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 TableExpression
Returns:
Object
Throws:
WTException

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 TableExpression
Returns:
boolean
Throws:
WTException

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 TableExpression
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 TableExpression
Parameters:
a_AdvancedQueryEnabled -

filterEmptyTables

public static Vector filterEmptyTables(Vector a_classInfos)
                                throws WTException
Throws:
WTException

getClassAccessControlRequired

public static boolean getClassAccessControlRequired(Vector a_classInfos)

toString

public String toString()

getClassInfos

protected Vector getClassInfos(boolean a_descendant)
                        throws QueryException
Throws:
QueryException

getAccessControlRequired

protected boolean getAccessControlRequired(Vector a_classInfos)

getTableReferenceMap

protected HashMap getTableReferenceMap(Class tableClass,
                                       String a_alias,
                                       ClassInfo[] a_classes,
                                       String[] a_tableAliases,
                                       Vector a_columns,
                                       boolean a_fullPersistableTable)
                                throws WTException
Throws:
WTException

getAutoNavigateClasses

private Vector getAutoNavigateClasses(Class a_class)
                               throws WTException
Throws:
WTException

getAutoNavigateMap

private Vector getAutoNavigateMap(Vector a_vector)
                           throws WTException
Throws:
WTException

buildJoinCondition

protected JoinClause buildJoinCondition(Class a_tableClass,
                                        String a_alias,
                                        HashMap a_map,
                                        boolean a_fullPersistable)
                                 throws WTException
Throws:
WTException

buildJoinCondition

protected String buildJoinCondition(String a_alias,
                                    Class a_tableClass,
                                    HashMap a_map,
                                    boolean a_fullPersistable)
                             throws WTException
Throws:
WTException

clone

public Object clone()
Returns a deep copy of this object.

Specified by:
clone in interface TableExpression
Returns:
Object