Answers for "hibernate select count"

2

hibernate select count

// 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