wt.query
Class SearchCondition

java.lang.Object
  extended bywt.query.SearchCondition
All Implemented Interfaces:
Externalizable, Serializable, WhereExpression

public class SearchCondition
extends Object
implements WhereExpression, Externalizable

This class represents a search condition on a query. When appended to a QuerySpec, the values will be used in the SQL WHERE clause.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  boolean advancedQueryEnabled
           
static String BETWEEN
           
private  int bindParameterCount
           
private  int bindParameterOffset
           
private static char CASE_INSENSITIVE_BYPASS_CHAR
           
private  List classAttributes
           
private static String CLASSNAME
           
static boolean DEBUG
           
private static DMLGenerator dmlGenerator
           
static String EQUAL
           
private static String ESCAPE
           
static long EXTERNALIZATION_VERSION_UID
           
private  int[] fromIndicies
           
static String GREATER_THAN
           
static String GREATER_THAN_OR_EQUAL
           
static String IN
           
static String IS_FALSE
           
static String IS_NULL
           
static String IS_TRUE
           
private  int isJoinCondition
           
private  int isJoinConditionForAutoNavi
           
private  JoinIndex joinFromIndicies
           
static int LEFT_FROM_INDEX
           
static int LEFT_OUTER_JOIN
          Indicates that the left hand side column is an outer join.
private  RelationalExpression leftHandSide
           
static String LESS_THAN
           
static String LESS_THAN_OR_EQUAL
           
static String LIKE
           
private static DebugWriter LOG
           
static int NO_OUTER_JOIN
          Indicates that no outer join column is specified.
static String NOT_BETWEEN
           
static String NOT_EQUAL
           
static String NOT_IN
           
static String NOT_LIKE
           
static String NOT_NULL
           
protected static long OLD_FORMAT_VERSION_UID
           
private  String operator
           
private  String option
           
private  int outerJoin
           
static char PATTERN_MATCH_MULITPLE
           
static char PATTERN_MATCH_SINGLE
           
private static String RESOURCE
           
static int RIGHT_FROM_INDEX
           
static int RIGHT_OUTER_JOIN
          Indicates that the right hand side column is an outer join.
private  RelationalExpression rightHandSide
           
(package private) static long serialVersionUID
           
 
Fields inherited from interface wt.query.WhereExpression
ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, BIND_PARAMETER, CORRELATED_CLASS_ATTRIBUTES, FROM_COUNT, FROM_INDICIES
 
Constructor Summary
SearchCondition()
          

Supported API: false
SearchCondition(Class targetClass, String anAttribute, boolean isNull)
          Specify a criteria for the query to test an attribute for NULL/NOT NULL.
SearchCondition(Class targetClass, String anAttribute, boolean isBetween, AttributeRange value)
          Specify a search condition for the query based on a range of a timestamp, long, float, or integer.
SearchCondition(Class targetClass, String targetAttribute, Class linkClass, String linkAttribute)
          Specify a criteria for the query to join a target and a link.
SearchCondition(Class targetClass, String attribute, Integer[] value, boolean negate)
          Specify a search condition for the query based on an array of values of a Integer attribute.
SearchCondition(Class targetClass, String anAttribute, long[] value)
          Specify a search condition for the query based on an array of values of a long attribute.
SearchCondition(Class targetClass, String anAttribute, long[] value, boolean negate)
          Specify a search condition for the query based on an array of values of a long attribute.
SearchCondition(Class targetClass, String anAttribute, String operator)
          Specify a search condition for the query based on a value of a boolean attribute.
SearchCondition(Class targetClass, String anAttribute, String[] value, boolean caseSensitive)
          Specify a search condition for the query based on an array of values of a String attribute.
SearchCondition(Class targetClass, String anAttribute, String[] value, boolean caseSensitive, boolean negate)
          Specify a search condition for the query based on an array of values of a String attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, BigDecimal value)
          Specify a search condition for the query based on a value of a BIGDECIMAL attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, boolean placeholder)
          Specify a criteria for the query to add a placeholder.
SearchCondition(Class targetClass, String anAttribute, String operator, byte value)
          Specify a search condition for the query based on a value of a byte attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Byte value)
          Specify a search condition for the query based on a value of a byte attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, char value)
          Specify a search condition for the query based on a value of a Character attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Character value)
          Specify a search condition for the query based on a value of a Character attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Date value)
          Specify a search condition for the query based on a value of a date attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, double value)
          Specify a search condition for the query based on a value of a double attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Double value)
          Specify a search condition for the query based on a value of a double attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, EnumeratedType value)
          Specify a search condition for the query based on an EnumeratedType.
SearchCondition(Class targetClass, String anAttribute, String operator, float value)
          Specify a search condition for the query based on a value of a float attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Float value)
          Specify a search condition for the query based on a value of a float attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, int value)
          Specify a search condition for the query based on a value of a integer attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Integer value)
          Specify a search condition for the query based on a value of a integer attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, long value)
          Specify a search condition for the query based on a value of a long attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Long value)
          Specify a search condition for the query based on a value of a long attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, ObjectIdentifier value)
          Create a search condition for the query based on a value of an ObjectIdentifier type.
SearchCondition(Class targetClass, String anAttribute, String operator, short value)
          Specify a search condition for the query based on a value of a short attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Short value)
          Specify a search condition for the query based on a value of a Short attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, String value)
          Specify a search condition for the query based on a value of a string attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, String value, boolean caseSensitive)
          Specify a search condition for the query based on a value of a string attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Time value)
          Specify a search condition for the query based on a value of a time attribute.
SearchCondition(Class targetClass, String anAttribute, String operator, Timestamp value)
          Specify a search condition for the query based on a value of a timestamp attribute.
SearchCondition(RelationalExpression a_leftHandSide, String a_operator)
          Constructs a SearchCondition.
SearchCondition(RelationalExpression a_leftHandSide, String a_operator, RelationalExpression a_rightHandSide)
          Constructs a SearchCondition.
SearchCondition(RelationalExpression a_leftHandSide, String a_operator, RelationalExpression a_rightHandSide, int a_leftFromIndex, int a_rightFromIndex)
          Deprecated. as of R6.0, use SearchCondition(RelationalExpression, String, RelationalExpression) and setFromIndicies(int[], int)
 
Method Summary
private  boolean checkAdvancedQuery(RelationalExpression a_expression)
           
private  boolean checkOperator(String a_operator)
           
private  void checkType(Class aJavaType, ClassAttribute targetClassAttribute)
           
static String convertCaseInsensitiveConstant(String a_value, boolean a_columnUpperCase)
           
 String getAttributeName()
          Deprecated. at R6.0, use getLeftHandSide()
 Object getBindParameter()
          Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported).
 Object getBindParameterFrom(Vector a_singleBindParameter)
          

Supported API: false
 List getClassAttributes()
          

Supported API: false
private  String getClause(boolean leftHandBind, boolean rightHandBind, Vector a_tableInfos, Vector a_aliases)
          String representation of the select where clause.
 List getCorrelatedClassAttributes()
          Gets the value of the attribute: correlatedClassAttributes.
private  DMLGenerator getDMLGenerator()
           
 String getExpression(boolean a_useBind, Vector a_tableInfos, Vector a_aliases)
          Return string representation of this expression.
 int getFromCount()
          Gets the value of the attribute: fromCount; Number of FromClause TableExpressions/Aliases that this expression requires.
 int[] getFromIndicies()
          Gets the value of the attribute: fromIndicies; Indicies for all current expressions relative to a FromClause that will be used for validating and setting aliases when this compostie expression is appended to a statement

Supported API: false
 WhereExpression getJoinConditions(JoinIndex a_joinIndex)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(Set a_joinIndexSet)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(String a_alias)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(String a_alias, boolean a_removed)
          This method is to return the join search condition.
 WhereExpression getJoinConditions(String a_alias, int a_outerNonJoinFromIndex, boolean a_removed)
          This method is to return the join search condition.
private  int[] getJoinFromIndex()
           
 Set getJoinIndex()
          

Supported API: false
 int getLeftFromIndex()
          Gets the value of the attribute: leftFromIndex; Index of left operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false
 RelationalExpression getLeftHandSide()
          Gets the object for the association that plays role: leftHandSide.
 String getOperator()
          Gets the value of the attribute: operator; Search condition operator.
 String getOption()
          Deprecated. as of R7.0, use the "UseEscape" attribute of wt.query.ConstantExpression.
 int getOuterJoin()
          Gets the value of the attribute: outerJoin; Indicates the outer join column, if applicable.
 int getRightFromIndex()
          Gets the value of the attribute: rightFromIndex; Index of right operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false
 RelationalExpression getRightHandSide()
          Gets the object for the association that plays role: rightHandSide.
 void handleCorrelatedAttributes(Vector a_tableInfos, Vector a_aliases)
          

Supported API: false
private  void initialize(Class queryClass, Class linkClass, String attribute, String linkAttribute, String operator)
           
private  void initialize(Class queryClass, String attribute, String operator, Object value)
           
private  void initialize(Class queryClass, String attribute, String operator, RelationalExpression rhs)
           
private  void initialize(RelationalExpression lhs, String a_operator, RelationalExpression rhs)
           
private  void initialize(RelationalExpression lhs, String a_operator, RelationalExpression rhs, int leftIndex, int rightIndex)
           
 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 isAllJoinConditions(JoinIndex a_joinIndex)
          

Supported API: false
 boolean isAllJoinConditions(Set a_joinIndexSet)
          

Supported API: false
 boolean isAllJoinConditions(String a_alias)
          

Supported API: false
 boolean isAllJoinConditions(String a_alias, boolean a_removed)
          

Supported API: false
 boolean isAllOuterNonJoinConditions()
          

Supported API: false
 boolean isJoinCondition()
          

Supported API: false
private  boolean isLikeEquals()
           
private  boolean isLikeUseBind()
           
private  boolean isOuterJoin(int a_outerJoinType)
           
private  void leftHandSideToUpper()
           
private  void optionValidate(String a_Option)
           
 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(SearchCondition 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.
 int setAliases(String[] a_aliases, int a_offset)
          This method sets the aliases for components of the expression.
 int setBindParameterIndicies(int a_offset)
          

Supported API: false
 int setFromIndicies(int[] a_fromIndicies, int a_offset)
          This method sets the From clause indicies for components of the expression.
 void setLeftFromIndex(int a_LeftFromIndex)
          Sets the value of the attribute: leftFromIndex; Index of left operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false
 void setOption(String a_Option)
          Deprecated. as of R7.0, use the "UseEscape" attribute of wt.query.ConstantExpression.
 void setOuterJoin(int a_OuterJoin)
          Sets the value of the attribute: outerJoin; Indicates the outer join column, if applicable.
 void setRightFromIndex(int a_RightFromIndex)
          Sets the value of the attribute: rightFromIndex; Index of right operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false
 String toString()
          String representation of the select where clause.
 int validate(TableExpression[] a_fromTables, int a_offset)
          This method validates the expression against the FROM clause.
private  void validateSearchTerm(Class javaType)
           
 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

operator

private String operator

option

private String option

outerJoin

private int outerJoin

NO_OUTER_JOIN

public static final int NO_OUTER_JOIN
Indicates that no outer join column is specified.

Supported API: true

See Also:
Constant Field Values

LEFT_OUTER_JOIN

public static final int LEFT_OUTER_JOIN
Indicates that the left hand side column is an outer join.

Supported API: true

See Also:
Constant Field Values

RIGHT_OUTER_JOIN

public static final int RIGHT_OUTER_JOIN
Indicates that the right hand side column is an outer join.

Supported API: true

See Also:
Constant Field Values

fromIndicies

private int[] fromIndicies

bindParameterOffset

private int bindParameterOffset

bindParameterCount

private int bindParameterCount

leftHandSide

private RelationalExpression leftHandSide

rightHandSide

private RelationalExpression rightHandSide

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

EQUAL

public static final String EQUAL
See Also:
Constant Field Values

NOT_EQUAL

public static final String NOT_EQUAL
See Also:
Constant Field Values

LIKE

public static final String LIKE
See Also:
Constant Field Values

NOT_LIKE

public static final String NOT_LIKE
See Also:
Constant Field Values

GREATER_THAN

public static final String GREATER_THAN
See Also:
Constant Field Values

GREATER_THAN_OR_EQUAL

public static final String GREATER_THAN_OR_EQUAL
See Also:
Constant Field Values

LESS_THAN

public static final String LESS_THAN
See Also:
Constant Field Values

LESS_THAN_OR_EQUAL

public static final String LESS_THAN_OR_EQUAL
See Also:
Constant Field Values

IS_TRUE

public static final String IS_TRUE
See Also:
Constant Field Values

IS_FALSE

public static final String IS_FALSE
See Also:
Constant Field Values

IS_NULL

public static final String IS_NULL
See Also:
Constant Field Values

NOT_NULL

public static final String NOT_NULL
See Also:
Constant Field Values

IN

public static final String IN
See Also:
Constant Field Values

BETWEEN

public static final String BETWEEN
See Also:
Constant Field Values

NOT_IN

public static final String NOT_IN
See Also:
Constant Field Values

NOT_BETWEEN

public static final String NOT_BETWEEN
See Also:
Constant Field Values

PATTERN_MATCH_MULITPLE

public static final char PATTERN_MATCH_MULITPLE
See Also:
Constant Field Values

PATTERN_MATCH_SINGLE

public static final char PATTERN_MATCH_SINGLE
See Also:
Constant Field Values

LEFT_FROM_INDEX

public static final int LEFT_FROM_INDEX
See Also:
Constant Field Values

RIGHT_FROM_INDEX

public static final int RIGHT_FROM_INDEX
See Also:
Constant Field Values

ESCAPE

private static final String ESCAPE

CASE_INSENSITIVE_BYPASS_CHAR

private static final char CASE_INSENSITIVE_BYPASS_CHAR
See Also:
Constant Field Values

dmlGenerator

private static DMLGenerator dmlGenerator

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG

isJoinCondition

private transient int isJoinCondition

classAttributes

private transient List classAttributes

isJoinConditionForAutoNavi

private transient int isJoinConditionForAutoNavi

joinFromIndicies

private transient JoinIndex joinFromIndicies
Constructor Detail

SearchCondition

public SearchCondition()


Supported API: false


SearchCondition

public SearchCondition(RelationalExpression a_leftHandSide,
                       String a_operator,
                       RelationalExpression a_rightHandSide)
                throws QueryException
Constructs a SearchCondition.

Supported API: true

Parameters:
a_leftHandSide - Left hand side operand.
a_operator - SQL operator
a_rightHandSide - Right hand side operand.
Throws:
QueryException

SearchCondition

public SearchCondition(RelationalExpression a_leftHandSide,
                       String a_operator)
                throws QueryException
Constructs a SearchCondition.

Supported API: true

Parameters:
a_leftHandSide - Left hand side operand.
a_operator - SQL operator
Throws:
QueryException

SearchCondition

public SearchCondition(RelationalExpression a_leftHandSide,
                       String a_operator,
                       RelationalExpression a_rightHandSide,
                       int a_leftFromIndex,
                       int a_rightFromIndex)
                throws QueryException
Deprecated. as of R6.0, use SearchCondition(RelationalExpression, String, RelationalExpression) and setFromIndicies(int[], int)



Supported API: false

Parameters:
a_leftHandSide - Left hand side operand.
a_operator - SQL operator
a_rightHandSide - Right hand side operand.
a_leftFromIndex -
a_rightFromIndex -
Throws:
QueryException

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       ObjectIdentifier value)
                throws QueryException
Create a search condition for the query based on a value of an ObjectIdentifier type. The attribute should specify an ObjectIdentifer property of the target class. Only the ID portion of the ObjectIdentifer is used in the where clause. The ID attribute of the ObjectIdentifier should not be included in the attribute name.

Supported API: true

Parameters:
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The ObjectIdentifier instance for the search condition.
Throws:
QueryException - Occurs if the given attribute is not a string type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       String value)
                throws QueryException
Specify a search condition for the query based on a value of a string attribute. The condition is of the form: string attribute, operator, value and the search is case sensitive.

Supported API: true

Parameters:
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The string value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not a string type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       String value,
                       boolean caseSensitive)
                throws QueryException
Specify a search condition for the query based on a value of a string attribute. The condition is of the form: string attribute, operator, value.

Supported API: true

Parameters:
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The string value for the search condition.
caseSensitive - true | false specify whether to ignore case in comparison
Throws:
QueryException - Occurs if the given attribute is not a string type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Character value)
                throws QueryException
Specify a search condition for the query based on a value of a Character attribute. The condition is of the form: Character attribute, operator, value and the search is case sensitive.

Supported API: true

Parameters:
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The Character value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not a string type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       char value)
                throws QueryException
Specify a search condition for the query based on a value of a Character attribute. The condition is of the form: Character attribute, operator, value and the search is case sensitive.

Supported API: true

Parameters:
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The char value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not a char type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String[] value,
                       boolean caseSensitive)
                throws QueryException
Specify a search condition for the query based on an array of values of a String attribute. The condition is of the form: String attribute, array of values.

Supported API: true

Parameters:
anAttribute - The long attribute name.
value - The array of String values for the search condition.
caseSensitive - true | false specify whether to ignore case in comparison
Throws:
QueryException - Occurs if the given attribute is not an long type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String[] value,
                       boolean caseSensitive,
                       boolean negate)
                throws QueryException
Specify a search condition for the query based on an array of values of a String attribute. The condition is of the form: String attribute, array of values.

Supported API: true

Parameters:
anAttribute - The long attribute name.
value - The array of String values for the search condition.
caseSensitive - true | false specify whether to ignore case in comparison
negate - sets search condition to NOT IN
Throws:
QueryException - Occurs if the given attribute is not an long type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator)
                throws QueryException
Specify a search condition for the query based on a value of a boolean attribute. The condition is of the form: integer attribute, operator.

Supported API: true

Parameters:
anAttribute - The boolean attribute name.
operator - The operators for the search condition: values may be IS_TRUE, IS_FALSE.
Throws:
QueryException - Occurs if the given attribute is not a boolean type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       BigDecimal value)
                throws QueryException
Specify a search condition for the query based on a value of a BIGDECIMAL attribute. The condition is of the form: BigDecimal attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The BigDecimal attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The BigDecimal value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an BigDecimal type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Byte value)
                throws QueryException
Specify a search condition for the query based on a value of a byte attribute. The condition is of the form: byte attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The byte attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The integer value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an Byte type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       byte value)
                throws QueryException
Specify a search condition for the query based on a value of a byte attribute. The condition is of the form: byte attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The byte attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The integer value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an byte type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Double value)
                throws QueryException
Specify a search condition for the query based on a value of a double attribute. The condition is of the form: double attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The double attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The double value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an Double type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       double value)
                throws QueryException
Specify a search condition for the query based on a value of a double attribute. The condition is of the form: double attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The double attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The double value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an double type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Float value)
                throws QueryException
Specify a search condition for the query based on a value of a float attribute. The condition is of the form: float attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The float attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The Float value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an Float type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       float value)
                throws QueryException
Specify a search condition for the query based on a value of a float attribute. The condition is of the form: float attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The float attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The Float value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an Float type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Integer value)
                throws QueryException
Specify a search condition for the query based on a value of a integer attribute. The condition is of the form: integer attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The integer attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The integer value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an integer type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       int value)
                throws QueryException
Specify a search condition for the query based on a value of a integer attribute. The condition is of the form: integer attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The integer attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The integer value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an int type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Long value)
                throws QueryException
Specify a search condition for the query based on a value of a long attribute. The condition is of the form: long attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The long attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The Long value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an Long type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       long value)
                throws QueryException
Specify a search condition for the query based on a value of a long attribute. The condition is of the form: long attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The long attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The long value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an long type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       long[] value)
                throws QueryException
Specify a search condition for the query based on an array of values of a long attribute. The condition is of the form: long attribute, array of values.

Supported API: true

Parameters:
anAttribute - The long attribute name.
value - The long value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an long type.

SearchCondition

public SearchCondition(Class targetClass,
                       String attribute,
                       Integer[] value,
                       boolean negate)
                throws QueryException
Specify a search condition for the query based on an array of values of a Integer attribute. The condition is of the form: int attribute, array of values.

Supported API: true

Parameters:
value - The Integer values for the search condition.
negate - sets search condition to NOT IN
Throws:
QueryException - Occurs if the given attribute is not an int type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       long[] value,
                       boolean negate)
                throws QueryException
Specify a search condition for the query based on an array of values of a long attribute. The condition is of the form: long attribute, array of values.

Supported API: true

Parameters:
anAttribute - The long attribute name.
value - The long values for the search condition.
negate - sets search condition to NOT IN
Throws:
QueryException - Occurs if the given attribute is not an long type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Short value)
                throws QueryException
Specify a search condition for the query based on a value of a Short attribute. The condition is of the form: short attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The short attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The Short value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an Short type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       short value)
                throws QueryException
Specify a search condition for the query based on a value of a short attribute. The condition is of the form: short attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The short attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The short value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an short type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Date value)
                throws QueryException
Specify a search condition for the query based on a value of a date attribute. The condition is of the form: date attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The date attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The date value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an date type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Time value)
                throws QueryException
Specify a search condition for the query based on a value of a time attribute. The condition is of the form: time attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The time attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The time value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an time type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       Timestamp value)
                throws QueryException
Specify a search condition for the query based on a value of a timestamp attribute. The condition is of the form: timestamp attribute, operator, value.

Supported API: true

Parameters:
anAttribute - The timestamp attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The timestamp value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an timestamp type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       boolean isBetween,
                       AttributeRange value)
                throws QueryException
Specify a search condition for the query based on a range of a timestamp, long, float, or integer. The condition is of the form: targetClass, attribute, boolean isBetween, AttributeRange value.

Supported API: true

Parameters:
anAttribute - The timestamp attribute name.
isBetween - Specifies whether to query for timestamps between the dates or not
value - The AttributeRange value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an timestamp type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       EnumeratedType value)
                throws QueryException
Specify a search condition for the query based on an EnumeratedType. The condition is of the form: targetClass, attribute name, operator, EnumeratedType value.

Supported API: true

Parameters:
anAttribute - The EnumeratedType attribute name.
operator - The operators for the search condition with a value from the Operator_Constant List i.e. EQUAL, LESS_THAN, etc.
value - The EnumeratedType value for the search condition.
Throws:
QueryException - Occurs if the given attribute is not an EnumeratedType type.

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       boolean isNull)
                throws QueryException
Specify a criteria for the query to test an attribute for NULL/NOT NULL.

Supported API: true

Parameters:
anAttribute - The attribute name.
Throws:
QueryException

SearchCondition

public SearchCondition(Class targetClass,
                       String targetAttribute,
                       Class linkClass,
                       String linkAttribute)
                throws QueryException
Specify a criteria for the query to join a target and a link.

Supported API: true

Parameters:
targetClass - The class of one side of the join
targetAttribute - The attribute to use on the join.
linkClass - The class Link or subclass of Link to be used with the join
linkAttribute - The attribute belonging to link to use on the join
Throws:
QueryException

SearchCondition

public SearchCondition(Class targetClass,
                       String anAttribute,
                       String operator,
                       boolean placeholder)
                throws QueryException
Specify a criteria for the query to add a placeholder. This constructor should NOT be used to specify a SearchCondition for a boolean attribute.

Supported API: true

Parameters:
targetClass - The class of anAttribute
anAttribute - The attribute to use on the left side of the equation
operator - Which operation, such as EQUAL
placeholder - boolean showing a placeholder should be inserted
Throws:
QueryException
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(SearchCondition 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

getAttributeName

public String getAttributeName()
Deprecated. at R6.0, use getLeftHandSide()

Gets the value of the attribute: attributeName; Target class attribute for the search condition.

Supported API: false

Returns:
String

getOperator

public String getOperator()
Gets the value of the attribute: operator; Search condition operator.

Supported API: false

Returns:
String

getOption

public String getOption()
Deprecated. as of R7.0, use the "UseEscape" attribute of wt.query.ConstantExpression.

Gets the value of the attribute: option; String representation of the option (for example, ESCAPE option for LIKE).

Supported API: true

Returns:
String

setOption

public void setOption(String a_Option)
               throws WTPropertyVetoException
Deprecated. as of R7.0, use the "UseEscape" attribute of wt.query.ConstantExpression.

Sets the value of the attribute: option; String representation of the option (for example, ESCAPE option for LIKE).

Supported API: true

Parameters:
a_Option -
Throws:
WTPropertyVetoException

optionValidate

private void optionValidate(String a_Option)
                     throws WTPropertyVetoException
Parameters:
a_Option -
Throws:
WTPropertyVetoException

getOuterJoin

public int getOuterJoin()
Gets the value of the attribute: outerJoin; Indicates the outer join column, if applicable.

Supported API: true

Returns:
int

setOuterJoin

public void setOuterJoin(int a_OuterJoin)
                  throws WTPropertyVetoException
Sets the value of the attribute: outerJoin; Indicates the outer join column, if applicable.

Supported API: true

Parameters:
a_OuterJoin -
Throws:
WTPropertyVetoException

getFromIndicies

public int[] getFromIndicies()
Gets the value of the attribute: fromIndicies; Indicies for all current expressions relative to a FromClause that will be used for validating and setting aliases when this compostie expression is appended to a statement

Supported API: false

Specified by:
getFromIndicies in interface WhereExpression
Returns:
int[]

getLeftFromIndex

public int getLeftFromIndex()
Gets the value of the attribute: leftFromIndex; Index of left operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false

Returns:
int

setLeftFromIndex

public void setLeftFromIndex(int a_LeftFromIndex)
Sets the value of the attribute: leftFromIndex; Index of left operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false

Parameters:
a_LeftFromIndex -

getRightFromIndex

public int getRightFromIndex()
Gets the value of the attribute: rightFromIndex; Index of right operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false

Returns:
int

setRightFromIndex

public void setRightFromIndex(int a_RightFromIndex)
Sets the value of the attribute: rightFromIndex; Index of right operand relative to a FromClause that will be used for validating and setting aliases when this SearchCondition is appended to a statement

Supported API: false

Parameters:
a_RightFromIndex -

getCorrelatedClassAttributes

public List getCorrelatedClassAttributes()
Gets the value of the attribute: correlatedClassAttributes.

Supported API: false

Specified by:
getCorrelatedClassAttributes in interface WhereExpression
Returns:
List

getLeftHandSide

public RelationalExpression getLeftHandSide()
Gets the object for the association that plays role: leftHandSide.

Supported API: false

Returns:
RelationalExpression

getRightHandSide

public RelationalExpression getRightHandSide()
Gets the object for the association that plays role: rightHandSide.

Supported API: false

Returns:
RelationalExpression

isJoinCondition

public boolean isJoinCondition()


Supported API: false

Returns:
boolean

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 WhereExpression
Returns:
Object
Throws:
WTException

getFromCount

public int getFromCount()
Gets the value of the attribute: fromCount; Number of FromClause TableExpressions/Aliases that this expression requires.

Supported API: false

Specified by:
getFromCount in interface WhereExpression
Returns:
int

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 WhereExpression
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 WhereExpression
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 WhereExpression
Parameters:
a_AdvancedQueryEnabled -

validate

public int validate(TableExpression[] a_fromTables,
                    int a_offset)
             throws QueryException
This method validates the expression against the FROM clause.

Supported API: false

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

setAliases

public int setAliases(String[] a_aliases,
                      int a_offset)
               throws QueryException
This method sets the aliases for components of the expression.

Supported API: false

Specified by:
setAliases in interface WhereExpression
Parameters:
a_aliases - Aliases to set.
a_offset - Offset index into the alias array for the next valid alias
Returns:
number of aliases used
Throws:
QueryException

getExpression

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

Supported API: false

Specified by:
getExpression in interface WhereExpression
Parameters:
a_useBind - Indicates if bind parameters should be used.
a_tableInfos -
a_aliases -
Returns:
String
Throws:
QueryException

setFromIndicies

public int setFromIndicies(int[] a_fromIndicies,
                           int a_offset)
This method sets the From clause indicies for components of the expression.

Supported API: true

Specified by:
setFromIndicies in interface WhereExpression
Parameters:
a_fromIndicies - From indicies to set.
a_offset - Offset index into the From indicies array for the next valid From index
Returns:
number of indicies used

getClassAttributes

public List getClassAttributes()


Supported API: false

Specified by:
getClassAttributes in interface WhereExpression
Returns:
List

getJoinConditions

public WhereExpression getJoinConditions(String a_alias)
                                  throws QueryException
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_alias -
Returns:
WhereExpression
Throws:
QueryException

isAllJoinConditions

public boolean isAllJoinConditions(String a_alias)
                            throws QueryException


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_alias -
Returns:
boolean
Throws:
QueryException

getJoinIndex

public Set getJoinIndex()


Supported API: false

Specified by:
getJoinIndex in interface WhereExpression
Returns:
Set

getJoinConditions

public WhereExpression getJoinConditions(JoinIndex a_joinIndex)
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_joinIndex -
Returns:
WhereExpression

isAllOuterNonJoinConditions

public boolean isAllOuterNonJoinConditions()


Supported API: false

Specified by:
isAllOuterNonJoinConditions in interface WhereExpression
Returns:
boolean

getBindParameterFrom

public Object getBindParameterFrom(Vector a_singleBindParameter)


Supported API: false

Specified by:
getBindParameterFrom in interface WhereExpression
Parameters:
a_singleBindParameter -
Returns:
Object

setBindParameterIndicies

public int setBindParameterIndicies(int a_offset)


Supported API: false

Specified by:
setBindParameterIndicies in interface WhereExpression
Parameters:
a_offset -
Returns:
int

getJoinConditions

public WhereExpression getJoinConditions(Set a_joinIndexSet)
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_joinIndexSet -
Returns:
WhereExpression

isAllJoinConditions

public boolean isAllJoinConditions(Set a_joinIndexSet)


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_joinIndexSet -
Returns:
boolean

isAllJoinConditions

public boolean isAllJoinConditions(JoinIndex a_joinIndex)


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_joinIndex -
Returns:
boolean

getJoinConditions

public WhereExpression getJoinConditions(String a_alias,
                                         boolean a_removed)
                                  throws QueryException
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_alias -
a_removed -
Returns:
WhereExpression
Throws:
QueryException

isAllJoinConditions

public boolean isAllJoinConditions(String a_alias,
                                   boolean a_removed)
                            throws QueryException


Supported API: false

Specified by:
isAllJoinConditions in interface WhereExpression
Parameters:
a_alias -
a_removed -
Returns:
boolean
Throws:
QueryException

getJoinConditions

public WhereExpression getJoinConditions(String a_alias,
                                         int a_outerNonJoinFromIndex,
                                         boolean a_removed)
                                  throws QueryException
This method is to return the join search condition.

Supported API: false

Specified by:
getJoinConditions in interface WhereExpression
Parameters:
a_alias -
a_outerNonJoinFromIndex -
a_removed -
Returns:
WhereExpression
Throws:
QueryException

handleCorrelatedAttributes

public void handleCorrelatedAttributes(Vector a_tableInfos,
                                       Vector a_aliases)


Supported API: false

Specified by:
handleCorrelatedAttributes in interface WhereExpression
Parameters:
a_tableInfos -
a_aliases -

convertCaseInsensitiveConstant

public static String convertCaseInsensitiveConstant(String a_value,
                                                    boolean a_columnUpperCase)

initialize

private void initialize(Class queryClass,
                        String attribute,
                        String operator,
                        Object value)
                 throws QueryException
Throws:
QueryException

initialize

private void initialize(Class queryClass,
                        Class linkClass,
                        String attribute,
                        String linkAttribute,
                        String operator)
                 throws QueryException
Throws:
QueryException

initialize

private void initialize(Class queryClass,
                        String attribute,
                        String operator,
                        RelationalExpression rhs)
                 throws QueryException
Throws:
QueryException

initialize

private void initialize(RelationalExpression lhs,
                        String a_operator,
                        RelationalExpression rhs)
                 throws QueryException
Throws:
QueryException

initialize

private void initialize(RelationalExpression lhs,
                        String a_operator,
                        RelationalExpression rhs,
                        int leftIndex,
                        int rightIndex)
                 throws QueryException
Throws:
QueryException

toString

public String toString()
String representation of the select where clause.

Returns:
String representation of this SearchCondition

getClause

private String getClause(boolean leftHandBind,
                         boolean rightHandBind,
                         Vector a_tableInfos,
                         Vector a_aliases)
                  throws QueryException
String representation of the select where clause.

Returns:
String representation of this SearchCondition
Throws:
QueryException

isOuterJoin

private boolean isOuterJoin(int a_outerJoinType)

isLikeUseBind

private boolean isLikeUseBind()

isLikeEquals

private boolean isLikeEquals()

validateSearchTerm

private void validateSearchTerm(Class javaType)
                         throws QueryException
Throws:
QueryException

checkType

private void checkType(Class aJavaType,
                       ClassAttribute targetClassAttribute)
                throws QueryException
Throws:
QueryException

leftHandSideToUpper

private void leftHandSideToUpper()
                          throws QueryException
Throws:
QueryException

checkAdvancedQuery

private boolean checkAdvancedQuery(RelationalExpression a_expression)

checkOperator

private boolean checkOperator(String a_operator)

getDMLGenerator

private DMLGenerator getDMLGenerator()

getJoinFromIndex

private int[] getJoinFromIndex()