Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL insert command

 
Vanderson Assis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ya'll.
I need to perform an insert with hibernate using HQL or SQL or anything that doesn't wait a select statement inside the query String. Just a simple insert like we do with SQL. Its my understanding that we can't use a raw SQL statement in hibernate am i wrong? If i'm, then how can i do it?

Thanks!!
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I am a little confused on the use case. When the transaction is committed hibernate should take care of doing any necessary inserts why would you want to do this? Also when doing something like this the persistence context would not be updated to reflect the results of the operation. You would be in essence by passing hibernates in memory structures, so you would want to be careful doing stuff like this regardless.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic