Mapping comparison operators: ComparisonOpMapper element
The ComparisonOpMapper element is used for customizing the mappings of the comparison operators listed in Table 10‑4. The table also shows the default template for each operator.
Table 10‑4 Default templates for mapping comparison operators
Comparison operator
Operand data types
Default template
Remarks
=
<INTEGER>, <INTEGER>
<DECIMAL>, <DECIMAL>
<DOUBLE>, <DOUBLE>
<VARCHAR>, <VARCHAR>
<TIMESTAMP>, <TIMESTAMP>
$P0 = $P1
Use EQ as the FunctionName for =.
>
$P0 > $P1
Use GT as the FunctionName for >.
<
$P0 < $P1
Use LT as the FunctionName for <.
>=
$P0 >= $P1
Use GE as the FunctionName for >=.
<=
$P0 <= $P1
Use LE as the FunctionName for <=.
< >
$P0 <> $P1
Use NE as the FunctionName for < >.
Example: Mapping the <> operator
You change the mapping of the <> operator for VARCHAR because on your database the comparison operator for strings is an exclamation point followed by an equals sign (!=). You use NE as the FunctionName:
<ComparisonOpMapper>
<FunctionMappings>
<FunctionMapping FunctionName="NE"
OperandTypes="VARCHAR VARCHAR">
$P0 != $P1
</FunctionMapping>
</FunctionMappings>
</ComparisonOpMapper>