【发布时间】:2016-11-29 06:41:49
【问题描述】:
我正在尝试在 Openjpa 中复制 Hibernate 的 “更新版本” 的行为:
em.createQuery("update versioned MyEntity m set m.otherEntity=null where m.otherEntity=:otherEntity).setParameter("otherEntity", otherEntity).executeUpdate();
我在 openjpa 中尝试了相同的查询,但我收到了此查询的错误(它将“版本化”作为别名),因此它显然是 HQL 功能。
【问题讨论】:
-
很明显,这是无效的 JPQL,所以您期望什么?
UPDATE entity_name [[AS] identification_variable] SET update_item {, update_item}* WHERE ... -
我期待一个答案,并没有提及我自己已经弄清楚并写在问题正文中的内容。
标签: java hibernate jpa openjpa