Developers notes
Programming Tips&Tricks
Wednesday, August 27, 2014
Count
Using criteria API:
session.createCriteria(Book.class).setProjection(
Projections.rowCount()
).uniqueResult();
or native SQL:
session.createQuery("
select count
(*) from Book").uniqueResult()
Ref:
https://stackoverflow.com/questions/1372317/how-do-we-count-rows-using-hibernate
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment