I am using Hibernate to execute data. I have 2 table as bellow.
TableA ( A1_Column, A2_Column, )
TableB ( A1_Column, B1_Column, )
I created sql query string as bellow:
strQuery = "UPDATE TableA as A, TableB as B SET A.A2_Column = 'aaa', B.B1_Column = 'bbb' WHERE A.A1_Column = B.A1_Column"
I executed query as bellow:
Session sess = getSession(); Query query = sess.createQuery(strQuery); query.executeUpdate();
So, It not execute when I run my application. It have error message same to "Update queries not support in through HQL".
I tried to use createSQLQuery for that problem, So they are the same.
Please help me for that problem. Thanks a lot.
P/S: I am not English or American. So, my English is very bad. I can't description as clearly. (I am sorry for that problem).
|