wt.query
Class ConstantExpression

java.lang.Object
  extended bywt.query.ConstantExpression
All Implemented Interfaces:
ColumnExpression, Expression, Externalizable, OrderByExpression, RelationalExpression, Serializable
Direct Known Subclasses:
DateExpression

public class ConstantExpression
extends Object
implements ColumnExpression, Externalizable

This class represents a constant in a SQL statement.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean advancedQueryEnabled
           
private static String CLASSNAME
           
private  String columnAlias
           
static boolean DEBUG
           
private static DMLGenerator dmlGenerator
           
private static String DOUBLE_SINGLE_QUOTE
           
static long EXTERNALIZATION_VERSION_UID
           
private static DebugWriter LOG
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String PLACEHOLDER
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static String SINGLE_QUOTE_TOKEN
           
private  boolean useEscape
           
private  Object value
           
 
Fields inherited from interface wt.query.ColumnExpression
ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, COLUMN_ALIAS, JAVA_TYPE
 
Fields inherited from interface wt.query.Expression
FROM_COUNT
 
Fields inherited from interface wt.query.RelationalExpression
BIND_PARAMETER
 
Constructor Summary
ConstantExpression()
          

Supported API: false
ConstantExpression(Object a_value)
          

Supported API: false
ConstantExpression(Object a_value, boolean a_includeQuote)
          Deprecated. As of R7.0, use ConstantExpression(Object)
ConstantExpression(String a_value)
          Deprecated. as of R7.0, use newExpression(Object).
 
Method Summary
 Object getBindParameter()
          Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).
 List getClassAttributes()
          

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

Supported API: false
 Class getJavaType()
          Gets the value of the attribute: javaType; The java type of this expression.
 Object getValue()
          Gets the value of the attribute: value; Constant value.
 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 isEscapeNeeded()
           
static boolean isEscapeNeeded(String a_value)
           
static boolean isStringBased(Class a_class)
           
private static boolean isStringBased(Object a_value)
           
static boolean isStringBased(String a_className)
           
 boolean isUseEscape()
          Gets the value of the attribute: useEscape.
static ColumnExpression newExpression(Object a_value)
          Create a new Expression.
static ColumnExpression newExpression(Object a_value, String a_javaType)
          Create a new Expression.
 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(ConstantExpression 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.
 void setColumnAlias(String a_ColumnAlias)
          Sets the value of the attribute: columnAlias; Alias for the column expression.
 int setFromAlias(String[] a_aliases, int a_offset)
          This method sets the FROM clause alias for this expression.
 void setUseEscape(boolean a_UseEscape)
          Sets the value of the attribute: useEscape.
 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

value

private Object value

useEscape

private boolean useEscape

columnAlias

private String columnAlias

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

PLACEHOLDER

private static final String PLACEHOLDER

dmlGenerator

private static DMLGenerator dmlGenerator

SINGLE_QUOTE_TOKEN

private static final String SINGLE_QUOTE_TOKEN

DOUBLE_SINGLE_QUOTE

private static final String DOUBLE_SINGLE_QUOTE
See Also:
Constant Field Values
Constructor Detail

ConstantExpression

public ConstantExpression()


Supported API: false


ConstantExpression

public ConstantExpression(Object a_value)


Supported API: false

Parameters:
a_value - Specifies the constant value.

ConstantExpression

public ConstantExpression(String a_value)
Deprecated. as of R7.0, use newExpression(Object).



Supported API: true

Parameters:
a_value - Specifies a String constant value.

ConstantExpression

public ConstantExpression(Object a_value,
                          boolean a_includeQuote)
Deprecated. As of R7.0, use ConstantExpression(Object)



Supported API: false

Parameters:
a_value - Specifies the constant value.
a_includeQuote - Indicates if the constant value should be quoted.
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(ConstantExpression 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

getValue

public Object getValue()
Gets the value of the attribute: value; Constant value.

Supported API: true

Returns:
Object

isUseEscape

public boolean isUseEscape()
Gets the value of the attribute: useEscape.

Supported API: false

Returns:
boolean

setUseEscape

public void setUseEscape(boolean a_UseEscape)
Sets the value of the attribute: useEscape.

Supported API: false

Parameters:
a_UseEscape -

newExpression

public static ColumnExpression newExpression(Object a_value,
                                             String a_javaType)
Create a new Expression.

Supported API: true

Parameters:
a_value - Specifies the constant value.
a_javaType - Specifies the Java type that this constant should be treated as.
Returns:
ColumnExpression

newExpression

public static ColumnExpression newExpression(Object a_value)
Create a new Expression.

Supported API: true

Parameters:
a_value - Specifies the constant value.
Returns:
ColumnExpression

getColumnAlias

public String getColumnAlias()
Gets the value of the attribute: columnAlias; Alias for the column expression.

Supported API: true

Specified by:
getColumnAlias in interface ColumnExpression
Returns:
String

setColumnAlias

public void setColumnAlias(String a_ColumnAlias)
                    throws WTPropertyVetoException
Sets the value of the attribute: columnAlias; Alias for the column expression.

Supported API: true

Specified by:
setColumnAlias in interface ColumnExpression
Parameters:
a_ColumnAlias -
Throws:
WTPropertyVetoException

getJavaType

public Class getJavaType()
                  throws WTException
Gets the value of the attribute: javaType; The java type of this expression.

Supported API: false

Specified by:
getJavaType in interface ColumnExpression
Returns:
Class
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 ColumnExpression
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 ColumnExpression
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 ColumnExpression
Parameters:
a_AdvancedQueryEnabled -

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

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

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

isEscapeNeeded

public static boolean isEscapeNeeded(String a_value)

isStringBased

public static boolean isStringBased(String a_className)
                             throws WTException
Throws:
WTException

isStringBased

public static boolean isStringBased(Class a_class)

isEscapeNeeded

public boolean isEscapeNeeded()

toString

public String toString()

isStringBased

private static boolean isStringBased(Object a_value)

getDMLGenerator

private DMLGenerator getDMLGenerator()