• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Write HQL Update query

 
Deepaks Deshpande
Ranch Hand
Posts: 114
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I have a Class QuestionBank as follows:


How will i write a HQL update query where i want to update the Question bank based on the questionId.

Thank you.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the update syntas of HQL. That is usually only used for bulk updates though. To just update one record you could select by id, update the values in the object and use Hibernate's update API.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic