How to execute an update via SQLQuery in Hibernate

Posted by Udo Fholl on Stack Overflow See other posts from Stack Overflow or by Udo Fholl
Published on 2010-04-14T12:11:45Z Indexed on 2010/04/14 12:13 UTC
Read the original article Hit count: 363

Filed under:
|
|

Hi,

I need to update a joined sub-class. Since Hibernate doesn't allow to update joined sub-classes in hql or named-query I want to do it via SQL. I also can't use a sql named-query because updates via named-query are not supported in Hibernate.

So I decided to use a SQLQuery. But Hibernate complaints about not calling addScalar().

Are updates returning the number of rows affected and how is named that column?

Are there any other ways to do an update on a joined sub-class in hibernate?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about sql