Answers for "hibernate count query"

2

hibernate create query count return

// All entries
Long count = (Long) session.createQuery("select count(ALL YourTable) from YourTable yourTable").getSingleResult();

// filtered entries
Long count = (Long) session.createQuery("select count(yourTable) from YourTable yourTable where yourTable.whatever = whatever").setParameter("whatever", yourParam).getSingleResult();
Posted by: Guest on June-29-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language