java - Hibernate HQL update with a subselect in set clause -


I'm trying to make an update in the Hibernate HQL that contains one set in a set clause:

Update UserObject set code = (Select n.code from someUserObject n where n.id = 1000)

This is not working, it is not supported ?

thanks

Udo

I had the same problem , Found out that you need it to put bulk updates with a transaction:

  tr = session.getTransaction (); Tr.begin (); UpdateQuery.executeUpdate (); Tr.commit;  

Comments