I am using hibernate 4 and Spring 3.
I have 5 tables and each table is mapped with 1 entity class.Now if I have to select columns from 1 table than i will do below :
String hql = "from Employee E";
Query query = session.createQuery(hql);
List results = query.list();
This value in this result will be of type EmployeeEntity.
Or I can use Criteria as well.
Now my requirnment is that I have to get the result from all 5 tables.1-2 columns from each table.
Earlier it was one 1 table so i was getting one entity , now I am getting results from 5 tables so how to map it in entity.
List results1 = query.list(); // considering select and getting 6 columns in results with diffenent tables.
Now how to iterate this result1.
I hope you got my question.