0

The first table contain list from Database and store in qry and the second table also contain list from Database and store in qry1 then how to append these list in the third qry2.

Query qry = getSession().createQuery("select * from table1");
Query qry1 = getSession().createQuery("select * from table2");
Query qry2 = dry+qry1;

1 Answer 1

1

Why don't you simple do

List<Object> result = new ArrayList<Object>();
result.addAll(qry.list());
result.addAll(qry1.list());

You have to take a List of Object's since the both Pojo's are different from table1 to table2.

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.