2

There are the following java-code:

EntityTransaction myTransaction = myManager.getTransaction();
myTransaction.begin();
System.out.println(myManager.createQuery("delete from UserProfile where id > 16787504").executeUpdate());
myTransaction.commit();

After run, the error occurs:

javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert/select ids for bulk delete
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
    at org.hibernate.ejb.QueryImpl.executeUpdate(QueryImpl.java:60)

Any solutions?

abg
  • 2,002
  • 7
  • 39
  • 63

0 Answers0