【发布时间】:2013-08-12 20:39:09
【问题描述】:
我需要执行批量插入选择语句:
Query query = em
.createQuery(
"insert into EntityA (a,b,entity_field) select t.a, t.b,
:entity_field from EntityA t where ...");
query.setParameter("entity_field ", entity);
字段 entity_field 不是 EntityA 中的原始类型 我收到 java.lang.IllegalArgumentException: org.hibernate.QueryException: number of select types does not match those for insert.
有什么办法吗?
【问题讨论】:
-
不,它适用于原始类型。
标签: hibernate jpa hql insert-select