Reputation: 19
String strhql="select max(e.salary),min(e.salary),avg(e.salary) from Employee e";
Query q=s.createQuery(strhql);
List l=q.list();
Upvotes: 0
Views: 35
Reputation: 15552
This is returning a list of objects
Effectively
List l = q.list()
could be 'typed' to
List<Object[]> l = (List<Object[]>) q.list();
then you can do
maxSal = (Integer)l.get(0)[0]
etc etc
Your question could be clearer but I think this is the answer to what you are asking. If not then please add more details to the question
Upvotes: 1