indexes = indexList.toArray(new FieldIndex[indexList.size()]);
} else if (constraintType.isComparison()) {
// look for a dual constraint to create a range index
if (USE_RANGE_INDEX && constraints[firstIndexableConstraint] instanceof MvelConstraint) {
MvelConstraint firstConstraint = (MvelConstraint) constraints[firstIndexableConstraint];
String leftValue = getLeftValueInExpression(firstConstraint.getExpression());
for (int i = firstIndexableConstraint+1; i < constraints.length; i++) {
if (constraints[i] instanceof MvelConstraint) {
MvelConstraint dualConstraint = (MvelConstraint) constraints[i];
if (isDual(firstConstraint, leftValue, dualConstraint)) {
constraintType = ConstraintType.RANGE;
if (firstConstraint.getConstraintType().isAscending()) {
ascendingConstraintType = firstConstraint.getConstraintType();
descendingConstraintType = dualConstraint.getConstraintType();
indexes = new FieldIndex[]{ firstConstraint.getFieldIndex(), dualConstraint.getFieldIndex() };
} else {
ascendingConstraintType = dualConstraint.getConstraintType();
descendingConstraintType = firstConstraint.getConstraintType();
indexes = new FieldIndex[]{ dualConstraint.getFieldIndex(), firstConstraint.getFieldIndex() };
}
return;
}
}
}