i tried to update my record using customize HQL. but i have encounter some problem.
My code is as follow:
Code:
String sql="update Enquiry enq SET enq.threadStatus= :threadStatus where enq.id= :threadId";
Query query=session.createQuery(sql);
query.setInteger("threadStatus",2);
query.setInteger("threadId", Integer.parseInt(threadId));
int result=query.executeUpate();
from my console my sql look like this:
update COLLAB_THREAD enquiry0_ set enquiry0_.THREAD_STATUS=? where (enquiry0_.ID=?)
my error is as follow:
Incorrect syntax near 'enquiry0_'.
org.hibernate.exception.SQLGrammarException: could not execute update query
please help. thanks.