wt.query
Class KeywordExpression

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

public class KeywordExpression
extends Object
implements ColumnExpression, Serializable

This class represents an expression that evaluates to a SQL keyword that can be used in a SQL statement. There is no special significance to the values represented by this class. When the value evaluates to a string representation it is not quoted and cannot be replaced with a bind parameter.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean advancedQueryEnabled
           
static KeywordExpression BIND_PARAMETER
          Constant keyword expression representing a SQL bind parameter.
private static String CLASSNAME
           
static KeywordExpression COLUMN_WILDCARD
          Constant keyword expression representing all columns.
private  String columnAlias
           
private  Class javaType
           
static KeywordExpression NULL
          Constant keyword expression representing SQL NULL.
private static String RESOURCE
           
static KeywordExpression ROWNUM
          Deprecated. as of R8.0, this keyword is not standard on all datastores.
private  String 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
 
Constructor Summary
private KeywordExpression()
           
  KeywordExpression(String a_value)
          Deprecated. Use newKeywordExpression(KeywordExpression)
private KeywordExpression(String a_value, Class a_javaType)
           
 
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.
 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.
 String getValue()
          Gets the value of the attribute: value; Keyword string representation.
 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.
static boolean isEqual(KeywordExpression k1, KeywordExpression k2)
           
static List list(boolean a_internalUseOnly, boolean a_advancedQuery)
          Returns a list of available keywords.
static KeywordExpression newKeywordExpression(KeywordExpression a_keyword)
          Creates a new KeywordExpression from the specified KeywordExpression constant.
static KeywordExpression newKeywordExpression(KeywordExpression a_keyword, Class a_javaType)
          Creates a new KeywordExpression from the specified KeywordExpression constant and type.
 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.
 String toString()
           
 int validate(TableExpression[] a_tableExpressions, int a_offset)
          This method validates this expression against the specified table expression.
 
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 String value

ROWNUM

public static final KeywordExpression ROWNUM
Deprecated. as of R8.0, this keyword is not standard on all datastores.

Constant keyword expression representing ROWNUM.

Supported API: false


COLUMN_WILDCARD

public static final KeywordExpression COLUMN_WILDCARD
Constant keyword expression representing all columns.

Supported API: true


NULL

public static final KeywordExpression NULL
Constant keyword expression representing SQL NULL.

Supported API: true


BIND_PARAMETER

public static final KeywordExpression BIND_PARAMETER
Constant keyword expression representing a SQL bind parameter.

Supported API: true


javaType

private Class javaType

columnAlias

private String columnAlias

advancedQueryEnabled

private transient boolean advancedQueryEnabled
Constructor Detail

KeywordExpression

private KeywordExpression()

KeywordExpression

public KeywordExpression(String a_value)
Deprecated. Use newKeywordExpression(KeywordExpression)



Supported API: false

Parameters:
a_value - Specifies the keyword.

KeywordExpression

private KeywordExpression(String a_value,
                          Class a_javaType)
Parameters:
a_value - Specifies the keyword.
a_javaType - Java type for this keyword
Method Detail

getValue

public String getValue()
Gets the value of the attribute: value; Keyword string representation.

Supported API: false

Returns:
String

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

newKeywordExpression

public static KeywordExpression newKeywordExpression(KeywordExpression a_keyword)
Creates a new KeywordExpression from the specified KeywordExpression constant.

Supported API: true

Parameters:
a_keyword - Specifies the keyword.
Returns:
KeywordExpression

newKeywordExpression

public static KeywordExpression newKeywordExpression(KeywordExpression a_keyword,
                                                     Class a_javaType)
                                              throws WTException
Creates a new KeywordExpression from the specified KeywordExpression constant and type.

Supported API: true

Parameters:
a_keyword - Specifies the keyword.
a_javaType - Specifies the type of the Keyword expression.
Returns:
KeywordExpression
Throws:
WTException

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

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

list

public static List list(boolean a_internalUseOnly,
                        boolean a_advancedQuery)
Returns a list of available keywords.

Supported API: false

Parameters:
a_internalUseOnly - indicates if keywords suitable for internal use only should be included
Returns:
List list of KeywordExpressions

isEqual

public static boolean isEqual(KeywordExpression k1,
                              KeywordExpression k2)

toString

public String toString()