我在执行以下休眠事务时收到以下错误:expecting DOT, found '=' near line 1, column 32 [update t_credential set status = :status , assigned_engine = :engine where id = :id]
。
此外,t_credential
是一个表,而不是一个对象。hibernate 是否允许以这种方式使用,还是强制必须是一个对象?
for(Credential credential: accountList){
Query query = ssn.createQuery("update t_credential set status =:status , assigned_engine = :engine where id = :id");
query.setParameter("status", status);
query.setParameter("engine", assignedTo);
query.setParameter("id", String.valueOf(credential.getId()));
int result = query.executeUpate();
}