Model firstRow=(Model) modeller;
please answer all my questions , thanks in advance
public List<Object> GetModels(String marka)
Session session = sessionFactory.getCurrentSession();
String hql = "from Model as m "
+ "inner join m.marka "
+ "Where marka=:marka";
Query query = session.createQuery(hql);
System.out.println("query is "+query);
// this is my question
List<Object> li= (List<Object>)query.list();
Model model=(Model) modeller;
System.out.println("test is "+model.getModel());
Dave Tolls wrote:Well, the first thing to do is find out what it is returning.
Actually, there's a join there, so it's likely an Object, with the first bit being a Model and the second being whatever markka is.
But you can check that by logging what the classes of the Objects in the array are.
Thanks, i got it