I have a simple code:
Code:
int updatedEntities = getHibernateTemplate().executeFind(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
return session.createQuery(
"UPDATE CustomerActionModel customerAction " +
"set customer = (select Customer customer where " +
"customer.customerId = customerAction.customerId) where customerAction.userTask.objecId = ?")
.setLong(0,userTask.getObjectId().longValue()).executeUpdate();
}
});
The method executeUpdate() is undefined for the type Query...
If put list() here it works (ofcourse if i remove updatedEntities)
But i would like to have an info if any of rows have been updated...
The int value would be mostly appreciated