Can anyone please tell me how to get the count for specific columns in HQL. In the below code I want the count of rows having parameters sClass and section. Some data is coming from the front end in sClass and section, on this basis I want the count.
public List<Integer> classSectionSearch(String sClass, String section) {
Query query = sessionFactory.getCurrentSession().createQuery("select sd.section, sd.sClass, count(*) from student_details sd where sd.sClass=:sClass and sd.section=:section");
query.setParameter("sClass", sClass);
query.setParameter("section", section);
List<Integer> count=query.list();
return count;
}