wt.query
Class ArrayTableExpression

java.lang.Object
  extended bywt.query.ArrayTableExpression
All Implemented Interfaces:
Cloneable, Expression, Externalizable, RelationalExpression, Serializable, TableExpression

public class ArrayTableExpression
extends Object
implements TableExpression, RelationalExpression, Externalizable

This class implements a TableExpression for an array of values that can be used as a table. It supports a table of explicit constant values or a table that uses a datastore type to pass all values as a single bind parameter.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean advancedQueryEnabled
           
private static String CLASSNAME
           
private static DMLGenerator DMLGENERATOR
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
private  String selectList
           
(package private) static long serialVersionUID
           
private  Class type
           
private  Object values
           
 
Fields inherited from interface wt.query.TableExpression
ACCESS_CONTROL_REQUIRED, ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, BIND_PARAMETER, DESCENDANTS_INCLUDED, TABLE_CLASS
 
Fields inherited from interface wt.query.RelationalExpression
BIND_PARAMETER
 
Fields inherited from interface wt.query.Expression
FROM_COUNT
 
Constructor Summary
ArrayTableExpression()
          Default constructor.
ArrayTableExpression(Class a_type, String a_selectList, Object a_values)
          This constructor initializes the instance.
 
Method Summary
 void appendClassAttribute(ClassAttribute a_classAttribute)
          

Supported API: false
private  String buildSelectList()
           
 Object clone()
          

Supported API: false
 void columnsReset()
          

Supported API: false
 Object getBindParameter()
          Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).
 List getClassAttributes()
          

Supported API: false
 ItemBuilder getColumnAccessItemBuilder(Class a_class, int a_fromIndex)
          

Supported API: false
 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.
 String getExpression(boolean a_useBind, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin)
          Return string representation of this expression.
private  String getExpression(String a_alias)
           
 int getFromCount()
          Gets the value of the attribute: fromCount; Number of from index values that this expression requires

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

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

Supported API: false
 String getSelectList()
          Gets the value of the attribute: selectList; The comma delimited list of fields in the table type.
 Class getTableClass()
          Gets the value of the attribute: tableClass; The associated class for the table expression (if supported).
 Vector getTables()
          Returns a Vector of TableExpressions corresponding to this TableExpression.
 Class getType()
          Gets the value of the attribute: type; The database type to use for the table.
 Class[] getValidClasses()
          Returns Class[] for tableClass and included Interfaces (If Supported)

Supported API: false
 Object getValues()
          Gets the value of the attribute: values; Array of values for the table

Supported API: false
 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.
 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 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(ArrayTableExpression 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.
 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.
 int setFromAlias(String[] a_aliases, int a_offset)
          This method sets the FROM clause alias for this expression.
 void setSelectList(String a_SelectList)
          Sets the value of the attribute: selectList; The comma delimited list of fields in the table type.
 void setType(Class a_Type)
          Sets the value of the attribute: type; The database type to use for the table.
 void setValues(Object a_Values)
          Sets the value of the attribute: values; Array of values for the table

Supported API: false
 int validate(TableExpression[] a_tableExpressions, int a_offset)
          This method validates this expression against the specified table expression.
 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, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

type

private Class type

selectList

private String selectList

values

private Object values

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 final DMLGenerator DMLGENERATOR
Constructor Detail

ArrayTableExpression

public ArrayTableExpression()
Default constructor.

Supported API: false


ArrayTableExpression

public ArrayTableExpression(Class a_type,
                            String a_selectList,
                            Object a_values)
                     throws WTPropertyVetoException
This constructor initializes the instance.

Supported API: false

Parameters:
a_type - Specifies the table type.
a_selectList - The list (comma delimited) of type fields for the table type
a_values - The list of values for the table
Throws:
WTPropertyVetoException
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(ArrayTableExpression 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

getType

public Class getType()
Gets the value of the attribute: type; The database type to use for the table.

Supported API: false

Returns:
Class

setType

public void setType(Class a_Type)
             throws WTPropertyVetoException
Sets the value of the attribute: type; The database type to use for the table.

Supported API: false

Parameters:
a_Type -
Throws:
WTPropertyVetoException

getSelectList

public String getSelectList()
Gets the value of the attribute: selectList; The comma delimited list of fields in the table type. If this list is not explicitly set, then the value will be derived from the datastore type.

Supported API: false

Returns:
String

setSelectList

public void setSelectList(String a_SelectList)
Sets the value of the attribute: selectList; The comma delimited list of fields in the table type. If this list is not explicitly set, then the value will be derived from the datastore type.

Supported API: false

Parameters:
a_SelectList -

getValues

public Object getValues()
Gets the value of the attribute: values; Array of values for the table

Supported API: false

Returns:
Object

setValues

public void setValues(Object a_Values)
               throws WTPropertyVetoException
Sets the value of the attribute: values; Array of values for the table

Supported API: false

Parameters:
a_Values -
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: false

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: false

Specified by:
setDescendantsIncluded in interface TableExpression
Parameters:
a_DescendantsIncluded -

getTableClass

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

Supported API: false

Specified by:
getTableClass in interface TableExpression
Returns:
Class

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

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 -

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 -

getTables

public 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 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 boolean isAutoNavigate()
                       throws WTException


Supported API: false

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

getJoinCondition

public 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

getColumnAccessItemBuilder

public 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 void appendClassAttribute(ClassAttribute a_classAttribute)


Supported API: false

Specified by:
appendClassAttribute in interface TableExpression
Parameters:
a_classAttribute -

getValidClasses

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

Supported API: false

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

getJoinCondition

public 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

columnsReset

public void columnsReset()


Supported API: false

Specified by:
columnsReset in interface TableExpression

isUseViewTableAlias

public boolean isUseViewTableAlias()


Supported API: false

Specified by:
isUseViewTableAlias in interface TableExpression
Returns:
boolean

clone

public Object clone()


Supported API: false

Specified by:
clone in interface TableExpression
Returns:
Object

getExpression

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

Supported API: false

Specified by:
getExpression in interface RelationalExpression
Parameters:
a_useBind - Indicates that bind variables should be used for this expression.
a_tableInfos -
a_aliases -
a_outerJoin - Indicates that outer join syntax should be used for this expression.
Returns:
String
Throws:
QueryException

getClassAttributes

public List getClassAttributes()


Supported API: false

Specified by:
getClassAttributes in interface RelationalExpression
Returns:
List

getFromCount

public int getFromCount()
Gets the value of the attribute: fromCount; Number of from index values that this expression requires

Supported API: false

Specified by:
getFromCount in interface Expression
Returns:
int

validate

public int validate(TableExpression[] a_tableExpressions,
                    int a_offset)
             throws QueryException
This method validates this expression against the specified table expression. A QueryException is thrown if this expression is not valid.

Supported API: false

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

setFromAlias

public int setFromAlias(String[] a_aliases,
                        int a_offset)
This method sets the FROM clause alias for this expression. This alias is used in this Expression in place of the corresponding TableExpression.

Supported API: false

Specified by:
setFromAlias in interface Expression
Parameters:
a_aliases - Array of aliases for expressions
a_offset - Offset index into the alias array for the next valid alias
Returns:
number of aliases used

getExpression

private String getExpression(String a_alias)
                      throws WTException
Throws:
WTException

buildSelectList

private String buildSelectList()
                        throws WTException
Throws:
WTException