Added buildQueryOrder.