I have the following query in my application:v
public List getLocation(String id) {
List object = null;
try {
org.hibernate.Transaction tx = session.beginTransaction();
Query q = session.createQuery("from Entrancestolocations as EL left join EL.entrances as E left join EL.location as L where L = " + id);
object = (List) q.list();
} catch (Exception e) {
e.printStackTrace();
}
return object;
}
The result of this query is a list . Entrancestolocations is a table with foreign key to location and entrances. I have no idea how to access the elements of this list without using the indexes as I don't know what is the type of objects that I deal with. The implementation is messed up - how to do it correctly? Which kind of object should I use to store the data from different tables from the database to be able to use them in an application? Thanks for help!