I have a Criteria with: Criteria criteria= session.createCriteria(Libro.class).addOrder( Order.asc("ID") );
However, when I want to get the rowcount fail:
criteria.setProjection(Projections.rowCount());
because there is an order by in the query.
How to remove dinamically the ordering in the Criteria? I mean, I am looking for like criteria.removeOrder("ID").
Thanks in advance