Hibernate version: 2.1.6
Name and version of the database you are using: mySQL 4.0.18
Hello,
is there a way to mix Query and Criteria objects, resp. to add Criterion objects to Query objects?
I want to implement a paginated search. This means query one is
"from Foo where ...." (+ setMaxResults()) and query two is "select count(*) from Foo where ...."
I found the Criteria API very convenient to add the single search criterias, especially because these are the same for both queries. However, I've no clue how to use these with a "select count(*)" query, which cannot (as I understand) constructed as a Criteria.
Any hints are most welcome.
Thanks,
Oliver
|