queryStringBuilder.append("ORDER BY ");
QuerySort querySort = query.getSort();
List<ColumnSort> sortColumns = querySort.getSortColumns();
int numOfSortColumns = sortColumns.size();
for (int col = 0; col < numOfSortColumns; col++) {
ColumnSort columnSort = sortColumns.get(col);
queryStringBuilder.append(getColumnId(columnSort.getColumn()));
if (columnSort.getOrder() == SortOrder.DESCENDING) {
queryStringBuilder.append(" DESC");
}
if (col < numOfSortColumns - 1) {
queryStringBuilder.append(", ");
}