Hi,
I have classes like this:
Code:
History{
Integer _id;
String _name;
MyObject _myObject;
}
MyObject{
Integer _id;
String _name;
}
And I have list:
Code:
List<MyObject> myObjects
I want to say that this list is not a list of full MyObjects... the Myobject have only _id, they dont have _name value;
I want to find all Histories which include myObject from the list. My idea was:
Code:
DetachedCriteria criteria = DetachedCriteria.forClass(History.class);
int i=0;
for (MyObject myObject: myObjects) {
criteria.createCriteria("myObject",i).add(Property.forName("id").eq(equipment.getId()));
i++;
}
return getHibernateTemplate().findByCriteria(criteria);
But Its not suprise for me that it doesnt work. Can anybody help me with this issue??