Token token = tree.getToken();
if (token == null) {
return null;
}
RHQLTreeOperator operator = getTreeOperatorFromTokenType(token.getType());
if (operator != null) {
for (int childIndex = 0; childIndex < tree.getChildCount(); childIndex++) {
CommonTree child = (CommonTree) tree.getChild(childIndex);
if (childIndex != 0) {
builder.append(" " + operator.name() + " ");
}
builder.append(generateJPQL(child));
}
} else {
List<RHQLTerm> terms = getFromAST(tree);