I have a table named Car. It has no primary key , so in Car.hbm.xml , all columns composite PK.And all columns accept null value.
So I have two class , Car.java and CarId.java.
When I execute the following snippet.It return list size is 2 , this is correct result, but all elements in list are null.Can someone tell me how to solve this problem?
Code:
Session session = sessionFactory.openSession();
String Hql = "from Car where id.CarName = 'ABC'";
Query query = session.createQuery(Hql);
return query.list();