I have a jsp page that paginates from database, that handles the pagination by adding where rownum between 1 and 20 to the sql. I`ve extended javax.faces.model.DataModel
That`s why I have to make the sorting same way. (by adding order by code to the sql)