wt.query
Class DateExpression

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

public class DateExpression
extends ConstantExpression
implements Externalizable

This class represents a date constant in a SQL statement. This subclass of ConstantExpression is necessary to provide the special handling for date values. The java date values are converted to a string representation and used within a TO_DATE() SQL function when used in SQL statements.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static String DATE_JAVA_FORMAT
           
static String DATE_JAVA_PARSE
           
private static DMLGenerator dmlGenerator
           
static long EXTERNALIZATION_VERSION_UID
           
private  String javaFormat
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static String TIME_JAVA_FORMAT
           
static String TIME_JAVA_PARSE
           
static String TIMESTAMP_JAVA_FORMAT
           
static String TIMESTAMP_JAVA_PARSE
           
private  boolean timezoneDependent
           
static String UTIL_DATE_JAVA_PARSE
           
 
Fields inherited from class wt.query.ConstantExpression
DEBUG
 
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
DateExpression()
          

Supported API: false
DateExpression(Date a_value)
          

Supported API: false
DateExpression(Date a_value, String a_javaFormat, boolean a_useTimezone)
          

Supported API: false
 
Method Summary
private  String format(boolean a_includeQuote)
           
 Object getBindParameter()
          Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).
private  DMLGenerator getDMLGenerator()
           
 String getExpression(boolean a_useBind, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin)
          Return string representation of this expression.
private static ColumnExpression newExpression(Date a_value)
           
private static ColumnExpression newExpression(Date a_value, String a_javaType)
           
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(DateExpression thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class wt.query.ConstantExpression
getClassAttributes, getColumnAlias, getFromCount, getJavaType, getValue, isAdvancedQuery, isAdvancedQueryEnabled, isEscapeNeeded, isEscapeNeeded, isStringBased, isStringBased, isUseEscape, newExpression, readVersion, setAdvancedQueryEnabled, setColumnAlias, setFromAlias, setUseEscape, toString, validate
 
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

javaFormat

private String javaFormat

timezoneDependent

private boolean timezoneDependent

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

DATE_JAVA_FORMAT

public static final String DATE_JAVA_FORMAT

TIME_JAVA_FORMAT

public static final String TIME_JAVA_FORMAT

TIMESTAMP_JAVA_FORMAT

public static final String TIMESTAMP_JAVA_FORMAT

DATE_JAVA_PARSE

public static final String DATE_JAVA_PARSE
See Also:
Constant Field Values

TIME_JAVA_PARSE

public static final String TIME_JAVA_PARSE
See Also:
Constant Field Values

TIMESTAMP_JAVA_PARSE

public static final String TIMESTAMP_JAVA_PARSE
See Also:
Constant Field Values

UTIL_DATE_JAVA_PARSE

public static final String UTIL_DATE_JAVA_PARSE

dmlGenerator

private static DMLGenerator dmlGenerator
Constructor Detail

DateExpression

public DateExpression()


Supported API: false


DateExpression

public DateExpression(Date a_value,
                      String a_javaFormat,
                      boolean a_useTimezone)


Supported API: false

Parameters:
a_value - Specifies the date value.
a_javaFormat - Specifies the date format used to construct the DateExpression.
a_useTimezone - Indicates if timezone (as specified in wt.properties) should be used construct the DateExpression.
See Also:
DateFormat

DateExpression

public DateExpression(Date a_value)


Supported API: false

Parameters:
a_value - Specifies the date constant value.
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
Overrides:
writeExternal in class ConstantExpression
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
Overrides:
readExternal in class ConstantExpression
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(DateExpression 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
Overrides:
getBindParameter in class ConstantExpression
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
Overrides:
getExpression in class ConstantExpression
Parameters:
a_useBind -
a_tableInfos -
a_aliases -
a_outerJoin - Indicates that outer join syntax should be used for this expression.
Returns:
String
Throws:
QueryException

newExpression

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

Supported API: true

Parameters:
a_value - Specifies the data constant value.
a_javaType - Specifies the Java type of the value.
Returns:
ColumnExpression

newExpression

private static ColumnExpression newExpression(Date a_value)
                                       throws WTException
Throws:
WTException

newExpression

private static ColumnExpression newExpression(Date a_value,
                                              String a_javaType)
                                       throws WTException
Throws:
WTException

format

private final String format(boolean a_includeQuote)

getDMLGenerator

private DMLGenerator getDMLGenerator()