// Add order by clause
if (this.ordering.size() > 0) {
XString xsOrderBy = new XString();
for (AttributeOrdering ao : this.ordering) {
xsOrderBy.assertEmptyOrText(", ");
xsOrderBy.addText(this.getActualColumnName(ao.getAttributeName()));
if (ao.getOrdering() == Ordering.DESCENDING) xsOrderBy.addText(" desc");
}
while (actualQuery.indexOf(this.orderByClausePlaceholder) > 0) {