How do I count the number of rows in Hibernate?

Asked 2 years ago, Updated 2 years ago, 167 views

For example, if you have a tablet book, how do you count the total number of books in Hibernate?

hibernate java count

2022-09-21 16:54

1 Answers

Let's say the class name is Book return (Number) session.createCriteria("Book").setProjection(Projections.rowCount()).uniqueResult();

You can get it this way.


2022-09-21 16:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.