Hi guys,
im having some troubles when i try to make an insert with hql. This is an example of what im trying to do
String hqlQuery = "insert into A (name,state) select name,:stateP from B"; Query query = session.createQuery(hqlQuery).setInteger("stateP",1);
That piece of code throws me the following exception
"Number of select types did not match those for insert"
In Entity A, state property is Integer.
I think the problem is in select statement. How can i add parameters in select clause in order to insert them with hql insert query ?
Im using Hibernate3
Thanks in advance
|