I am working on a web application using Hibernate, struts and extjs, Here is my scenario.
String hql = "from product";
In my product table three columns are there id, name, section
I need the results based on distinct name of product but i have only option is writing hql no other option is there.
I can use group by but i need the size of the result
so i am using hql.list().get(0);
In my code above code is in common method that is every dao uses the same method.
I can use joins but the data is in millions so execution of query is too slow, So can any one help how can i write distinct keyword in hql.