I need to execute batch insert select statement:
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);
Field entity_field is not a primitive type in EntityA I am getting java.lang.IllegalArgumentException: org.hibernate.QueryException: number of select types did not match those for insert.
Is there some way to do that?