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 dynamically the ordering in the Criteria?
I mean, I am looking for like criteria.removeOrder("ID")
.
addOrder()
if you don't want it? – Aquileia