For example I have a table as Student it's contain columns like id, name, age I am reverting particular column values by using NativeQuery like below.
Query query = entityManager.createNativeQuery("SELECT age FROM Student");
List list=query.getResultList();
By using above query We will get list of ages in Student table Now I want to get age and name from table.
Query query = entityManager.createNativeQuery("SELECT age,name FROM Student");
List list=query.getResultList();
If I do like this My code is execute well, but How can I get name in one list and age in another list.So how can I do this. Thank you very much
Note I don't have any Entity class or POJO classes in my project I am getting table from Database using Native Query.