## org.eclipse.datatools.connectivity.oda.spec
Class ExpressionVariable

    java.lang.Object
      org.eclipse.datatools.connectivity.oda.spec.ExpressionVariable

    public class ExpressionVariable

extends java.lang.Object

Represents the variable of an expression defined in an ODA query specification.
It is the responsibility of an ODA driver to resolve a variable, when evaluating it with an expression. This may be extended to represent complex types of variables.

Since:
  3.3 (DTP 1.8)

Nested Class Summary
`static class` `ExpressionVariable.VariableType`

Field Summary
`static java.lang.String` `ALIAS_SEPARATOR`

Constructor Summary
`ExpressionVariable(ColumnIdentifier columnIdentifier)` Constructor for an expression variable that references a result set column by its identifier.
`ExpressionVariable(java.lang.String variableIdentfier)` Constructor for an expression variable that references a result set column by name or expression.
`ExpressionVariable(java.lang.String variableIdentfier, ExpressionVariable.VariableType varType)` Constructor for an expression variable of the specified type.
`ExpressionVariable(ValueExpression valueExpr)` Constructor for an expression variable that references the specified value expression.

Method Summary
`java.lang.String` `getAlias()` Gets the variable alias.
`java.lang.String` `getIdentifier()` Gets the name or expression that identifies the variable in evaluating an expression.
`java.lang.Integer` `getNativeDataType()` Deprecated. replaced by `getOdaDataType()`
`java.lang.Integer` `getOdaDataType()` Gets the ODA-defined code value of this variable's data type.
`ExpressionVariable.VariableType` `getType()` Gets the type of this variable, e.g.
`ValueExpression` `getValueExpression()` Returns the value expression of this variable.
`void` `setAlias(java.lang.String alias)` Specifies the variable alias.
`void` `setNativeDataType(java.lang.Integer nativeDataTypeCode)` Deprecated. replaced by `ValueExpression.setOdaDataType(Integer)`
`void` `setType(ExpressionVariable.VariableType type)` Deprecated. replaced by deriving from the type of ValueExpression in this variable
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### ALIAS_SEPARATOR

    public static final java.lang.String ALIAS_SEPARATOR

See Also:
  Constant Field Values

Constructor Detail

### ExpressionVariable

    public ExpressionVariable(java.lang.String variableIdentfier)

  Constructor for an expression variable that references a result set column by name or expression.

  Parameters:
    `variableIdentfier` - the name or expression that identifies the variable to use in evaluating an expression. The identifier must be in a format recognized by the ODA data provider that will be evaluating the expression.

### ExpressionVariable

    public ExpressionVariable(java.lang.String variableIdentfier,
                              ExpressionVariable.VariableType varType)

  Constructor for an expression variable of the specified type.

  Parameters:
    `variableIdentfier` - the name or expression that identifies the variable to use in evaluating an expression. The identifier must be in a format recognized by the ODA data provider that will be evaluating the expression.
    `type` - the type of variable; its value must be one of the pre-defined `ExpressionVariable.VariableType`

### ExpressionVariable

    public ExpressionVariable(ColumnIdentifier columnIdentifier)

  Constructor for an expression variable that references a result set column by its identifier.

  Parameters:
    `columnIdentifier` - a column identifier

### ExpressionVariable

    public ExpressionVariable(ValueExpression valueExpr)

  Constructor for an expression variable that references the specified value expression.

  Parameters:
    `valueExpr` - a concrete ValueExpression instance

Method Detail

### getValueExpression

    public ValueExpression getValueExpression()

  Returns the value expression of this variable.

  Returns:
    an instance of a concrete ValueExpression

### getIdentifier

    public java.lang.String getIdentifier()

  Gets the name or expression that identifies the variable in evaluating an expression.

  Returns:
    the name or expression of the variable

### getAlias

    public java.lang.String getAlias()

  Gets the variable alias.

  Returns:
    the alias, or the identifier if no alias is specified

### setAlias

    public void setAlias(java.lang.String alias)

  Specifies the variable alias.

  Parameters:
    `alias` - the alias to set; may be null

### getType

    public ExpressionVariable.VariableType getType()

  Gets the type of this variable, e.g. a column in a query result set.

  Returns:
    a VariableType enum value

### setType

    public void setType(ExpressionVariable.VariableType type)

  Deprecated. replaced by deriving from the type of ValueExpression in this variable

  Sets the type of variable, e.g. a column in a query result set.

  Parameters:
    `type` - a VariableType enum value

### getNativeDataType

    public java.lang.Integer getNativeDataType()

  Deprecated. replaced by `getOdaDataType()`

  Gets the data provider specific code value of this variable's data type. The valid values are implementation-specific. This serves as an optional hint that may have been specified at design time.

  Returns:
    the native data type code of this variable, or null if not available

### setNativeDataType

    public void setNativeDataType(java.lang.Integer nativeDataTypeCode)

  Deprecated. replaced by `ValueExpression.setOdaDataType(Integer)`

  Sets the data type of this variable in a data provider specific code value. The valid values are implementation-specific. This serves as an optional hint that may have been specified at design time, and may be ignored by the runtime driver, if appropriate.

  Parameters:
    `nativeDataTypeCode` - the native data type code of this variable; may be null to unset current value

### getOdaDataType

    public java.lang.Integer getOdaDataType()

  Gets the ODA-defined code value of this variable's data type. This serves as an optional hint that may have been specified by the variable expression.

  Returns:
    the ODA data type code of this variable, or null if not available

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`