The following @OrderBy clause works: clause="CASE WHEN (displayOrder is null) then 1 else null end, displayOrder, category_name", mind the brackets. The issue can be closed.