break;
}
assert operandBuilder != null;
if (spec.getAttributeName() != null) {
// This order by is defined by an attribute ...
NameTest attribute = spec.getAttributeName();
assert !attribute.isWildcard();
operandBuilder.propertyValue(tableName, attribute.toString());
builder.select(tableName + "." + attribute.toString());
} else {
// This order-by is defined by a "jcr:score" function ...
FunctionCall scoreFunction = spec.getScoreFunction();
assert scoreFunction != null;
List<Component> args = scoreFunction.getParameters();
String nameOfTableToScore = tableName;
if (!args.isEmpty()) {
if (args.size() == 1 && args.get(0) instanceof NameTest) {
// Just the table name ...
NameTest tableNameTest = (NameTest)args.get(0);
nameOfTableToScore = tableNameTest.toString();
}
}
operandBuilder.fullTextSearchScore(nameOfTableToScore);
}
}