wt.query
Class ArrayExpression

java.lang.Object
  extended bywt.query.ArrayExpression
All Implemented Interfaces:
ArrayChunkProcessor, Expression, Externalizable, RelationalExpression, Serializable

public class ArrayExpression
extends Object
implements RelationalExpression, ArrayChunkProcessor, Externalizable

This class represents an array of constants in a SQL IN clause.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  Object[] array
           
private  boolean bindOptimizationEnabled
           
private  int chunkSize
           
private static String CLASSNAME
           
private static String DATE_TABLE_TYPE
           
private static DMLGenerator dmlGenerator
           
static long EXTERNALIZATION_VERSION_UID
           
private static StatementParameterFactory FACTORY
           
private  boolean includeQuote
           
private  int length
           
private static String NUMBER_TABLE_TYPE
           
protected static long OLD_FORMAT_VERSION_UID
           
private  String oracleType
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static String VARCHAR2_TABLE_TYPE
           
 
Fields inherited from interface wt.query.RelationalExpression
BIND_PARAMETER
 
Fields inherited from interface wt.query.Expression
FROM_COUNT
 
Fields inherited from interface wt.pds.ArrayChunkProcessor
CHUNK_COUNT, CHUNK_SIZE, SIZE
 
Constructor Summary
  ArrayExpression()
          

Supported API: false
  ArrayExpression(long[] a_value)
          

Supported API: true
  ArrayExpression(long[] a_value, int a_length)
          

Supported API: true
  ArrayExpression(Object[] a_value)
          

Supported API: true
  ArrayExpression(Object[] a_value, int a_length)
          

Supported API: true
private ArrayExpression(Object[] a_value, int a_offset, int a_length, boolean a_includeQuote, String a_oracleType)
           
  ArrayExpression(Object[] a_value, int a_length, String a_javaTypeName)
           
  ArrayExpression(Object[] a_value, String a_javaTypeName)
           
  ArrayExpression(String[] a_value)
          

Supported API: true
  ArrayExpression(String[] a_value, int a_length)
          

Supported API: true
 
Method Summary
 Object getBindParameter()
          Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).
 List getChunkBindParameters(int a_sqlIndex)
          This method returns a list of values to be used as bind parameters for an individual chunk.
 int getChunkCount()
          Gets the value of the attribute: chunkCount; Number of chunks for this array.
static int getChunkCount(int a_size, int a_chunkSize)
           
 int getChunkSize()
          Gets the value of the attribute: chunkSize; Size of each individual chunk for this array.
 List getClassAttributes()
          

Supported API: false
private  DMLGenerator getDMLGenerator()
           
 String getExpression(boolean a_useBind, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin)
          Return string representation of this expression.
private  int getFixedLength()
           
 int getFromCount()
          Gets the value of the attribute: fromCount; Number of from index values that this expression requires

Supported API: false
private static int getMinNaturalLength(int l1, int l2)
           
 int getSize()
          Gets the value of the attribute: size; Size of the array to be chunked.
private  int getStartIndex(int a_sqlIndex)
           
private  boolean isBindEnabled()
           
 boolean isBindOptimizationEnabled()
          Gets the value of the attribute: bindOptimizationEnabled; Indicates if bind optimization is enabled.
(package private)  boolean isSplitRequired(boolean a_useBind)
           
static ArrayExpression newArrayExpression(String inList, String delimiter, boolean is_string)
           
 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(ArrayExpression thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setBindOptimizationEnabled(boolean a_BindOptimizationEnabled)
          Sets the value of the attribute: bindOptimizationEnabled; Indicates if bind optimization is enabled.
 void setChunkSize(int a_ChunkSize)
          Sets the value of the attribute: chunkSize; Size of each individual chunk for this array.
 int setFromAlias(String[] a_aliases, int a_offset)
          This method sets the FROM clause alias for this expression.
(package private)  ArrayExpression[] split(boolean a_useBind)
           
 String toString()
           
 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
clone, 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

length

private int length

array

private Object[] array

includeQuote

private boolean includeQuote

oracleType

private String oracleType

bindOptimizationEnabled

private boolean bindOptimizationEnabled

chunkSize

private int chunkSize

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

FACTORY

private static final StatementParameterFactory FACTORY

VARCHAR2_TABLE_TYPE

private static final String VARCHAR2_TABLE_TYPE

NUMBER_TABLE_TYPE

private static final String NUMBER_TABLE_TYPE

DATE_TABLE_TYPE

private static final String DATE_TABLE_TYPE

dmlGenerator

private static DMLGenerator dmlGenerator
Constructor Detail

ArrayExpression

public ArrayExpression()


Supported API: false


ArrayExpression

public ArrayExpression(long[] a_value)


Supported API: true

Parameters:
a_value - Array of constant long values.

ArrayExpression

public ArrayExpression(String[] a_value)


Supported API: true

Parameters:
a_value - Array of constant String values.

ArrayExpression

public ArrayExpression(long[] a_value,
                       int a_length)


Supported API: true

Parameters:
a_value - Array of constant long values.
a_length - Number of valid values in the a_value array.

ArrayExpression

public ArrayExpression(String[] a_value,
                       int a_length)


Supported API: true

Parameters:
a_value - Array of constant String values.
a_length - Number of valid values in the a_value array.

ArrayExpression

public ArrayExpression(Object[] a_value)


Supported API: true

Parameters:
a_value - Array of constant values.

ArrayExpression

public ArrayExpression(Object[] a_value,
                       int a_length)


Supported API: true

Parameters:
a_value - Array of constant values.
a_length - Number of valid values in the a_value array.

ArrayExpression

public ArrayExpression(Object[] a_value,
                       String a_javaTypeName)
                throws WTException

ArrayExpression

public ArrayExpression(Object[] a_value,
                       int a_length,
                       String a_javaTypeName)
                throws WTException

ArrayExpression

private ArrayExpression(Object[] a_value,
                        int a_offset,
                        int a_length,
                        boolean a_includeQuote,
                        String a_oracleType)
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(ArrayExpression 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 RelationalExpression
Returns:
Object
Throws:
WTException

isBindOptimizationEnabled

public boolean isBindOptimizationEnabled()
Gets the value of the attribute: bindOptimizationEnabled; Indicates if bind optimization is enabled.

Supported API: false

Returns:
boolean

setBindOptimizationEnabled

public void setBindOptimizationEnabled(boolean a_BindOptimizationEnabled)
                                throws WTPropertyVetoException
Sets the value of the attribute: bindOptimizationEnabled; Indicates if bind optimization is enabled.

Supported API: false

Parameters:
a_BindOptimizationEnabled -
Throws:
WTPropertyVetoException

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

getSize

public int getSize()
Gets the value of the attribute: size; Size of the array to be chunked.

Supported API: false

Specified by:
getSize in interface ArrayChunkProcessor
Returns:
int

getChunkCount

public int getChunkCount()
Gets the value of the attribute: chunkCount; Number of chunks for this array.

Supported API: false

Specified by:
getChunkCount in interface ArrayChunkProcessor
Returns:
int

getChunkSize

public int getChunkSize()
Gets the value of the attribute: chunkSize; Size of each individual chunk for this array.

Supported API: false

Specified by:
getChunkSize in interface ArrayChunkProcessor
Returns:
int

setChunkSize

public void setChunkSize(int a_ChunkSize)
                  throws WTPropertyVetoException
Sets the value of the attribute: chunkSize; Size of each individual chunk for this array.

Supported API: false

Specified by:
setChunkSize in interface ArrayChunkProcessor
Parameters:
a_ChunkSize -
Throws:
WTPropertyVetoException

getChunkBindParameters

public List getChunkBindParameters(int a_sqlIndex)
                            throws WTException
This method returns a list of values to be used as bind parameters for an individual chunk.

Supported API: false

Specified by:
getChunkBindParameters in interface ArrayChunkProcessor
Parameters:
a_sqlIndex - Index of the SQL statement for this chunk.
Returns:
List
Throws:
WTException

getChunkCount

public static int getChunkCount(int a_size,
                                int a_chunkSize)

toString

public String toString()

getMinNaturalLength

private static int getMinNaturalLength(int l1,
                                       int l2)

isBindEnabled

private boolean isBindEnabled()

isSplitRequired

boolean isSplitRequired(boolean a_useBind)

split

ArrayExpression[] split(boolean a_useBind)

getFixedLength

private int getFixedLength()

getStartIndex

private int getStartIndex(int a_sqlIndex)

newArrayExpression

public static ArrayExpression newArrayExpression(String inList,
                                                 String delimiter,
                                                 boolean is_string)

getDMLGenerator

private DMLGenerator getDMLGenerator()