0
String strhql="select max(e.salary),min(e.salary),avg(e.salary) from Employee e";
Query q=s.createQuery(strhql);
List l=q.list();

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.