// 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();
Query query = session.createQuery(
"select count(*) from LoginClass login where login.emailid=:email and login.password=:password");
query.setString("email", "something");
query.setString("password", "password");
Long count = (Long)query.uniqueResult();