Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #hibernate #select #count
ADD COMMENT
Topic
Name
2+6 =