【发布时间】:2019-12-15 03:32:19
【问题描述】:
不支持 DML 操作
List<LeadsRequest> updateEngg = getEntityManager().createQuery("UPDATE LeadsRequest l set l.status = :status where l.id = :id")
.setParameter("status", status).setParameter("id",id).getResultList();
java.lang.IllegalStateException: org.hibernate.hql.internal.QueryExecutionRequestException: Not supported for DML operations
【问题讨论】:
-
请说明您的尝试,并提出明确的问题。寻求帮助:How to ask a good question
-
getResultList显然不起作用,即对于SELECT查询,请改用executeUpdate。
标签: mysql spring hibernate hql