Hibernate JPQL throws Update/delete queries cannot be typed

不羁的心 提交于 2019-12-05 14:28:29

Change your DELETE query to:

Query query = Seller.entityManager().createQuery(
    "DELETE FROM Seller AS o WHERE o.company=:company AND o.id=:id");
query.setParameter("company", company);
query.setParameter("id", id);
int result = query.executeUpdate();

The DML JPQL queries are not typed, because they only return the affected rows and so they don't need a return type.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!