I have this method that return a list :
public List getPourcentageDivision() {
List cs = null;
try {
org.hibernate.Transaction tx = session.beginTransaction();
Query q = session.createSQLQuery("SELECT u.division,COUNT(c.id) AS nb_commandes FROM utilisateur u LEFT OUTER JOIN commande c ON c.utilisateur_id = u.id GROUP BY u.division");
if(q.list().size() > 0)
cs = q.list();
session.clear();
session.flush();
} catch (Exception e) {
e.printStackTrace();
}
return cs;
}
like you see , every row return two attribute like it is in this query :
SELECT u.division,COUNT(c.id)
can you remember me how to access this data from this list, because I got into the habit if having List<MyClass> and it was easy to retrieve data but this time I am in front of a complex query to draw chart
How can I achieve this?