0 Replies Latest reply on Mar 20, 2007 2:28 PM by smokingapipe

    No joins on an update

    smokingapipe

      I'm trying to do a bulk update query like this:

      update Foo
       set status = 99
       where address.city = :x
      


      This isn't working. It's throwing an SQL error:

      javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute update query
      caused by
      org.postgresql.util.PSQLException: ERROR: syntax error at or near ","


      (I'm only posting the two relevant lines here.)

      I looked at the http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/batch.html#batch-direct and saw:

      No joins (either implicit or explicit) can be specified in a bulk EJB-QL query.


      I assume this is the limitation I'm running into here.

      Should I re-write this as a native query?