 119 | Method javax.persistence.Query int executeUpdate() Execute an update or delete statement. Returns: the number of entities updated or deleted Throws: IllegalStateException - if called for a Java Persistence query language SELECT statement or for a criteria query TransactionRequiredException |
 107 | , area = 0 UPDATE queries are executed using the executeUpdate method:
Query query = em.createQuery(
"UPDATE Country SET population = 0, area = 0");
int updateCount = em.executeUpdate(); A TransactionRequiredException is thrown if no transaction is active. On success - the executeUpdate |
 107 | all the objects in the database:
DELETE FROM Object DELETE queries are executed using the executeUpdate method:
int deletedCount = em.createQuery("DELETE FROM Country").executeUpdate(); A TransactionRequiredException is thrown if no transaction is active. On success - the executeUpdate method |
 58 | : Query.executeUpdate - for running only DELETE and UPDATE queries. Ordinary Query Execution ... , they have to be caught and handled. DELETE and UPDATE Query Execution (with executeUpdate) DELETE and UPDATE queries are executed using the executeUpdate method. For example, the following query deletes |
 7 | javax.persistence Interface TypedQuery Superinterfaces: Query Interface used to control the execution of typed queries. Since: JPA 2.0 See Also: Query Parameter Learn how to define and use JPA/JPQL queries in Chapter 4 of the ObjectDB/JPA manual. int executeUpdate() Execute an update or delete |
 7 | javax.persistence Interface Query Subinterfaces: TypedQuery Interface used to control query execution. Since: JPA 1.0 See Also: TypedQuery Parameter Learn how to define and use JPA/JPQL queries in Chapter 4 of the ObjectDB/JPA manual. int executeUpdate() Execute an update or delete statement |
 5 | :69)
at com.objectdb.o.OBC.onObjectDBError(OBC.java:1485)
at com.objectdb.jpa.JpaQuery.executeUpdate ... .java:232)
at com.objectdb.o.QRR.b(QRR.java:151)
at com.objectdb.jpa.JpaQuery.executeUpdate(JpaQuery ... .executeUpdate();
query = em.createQuery("DELETE FROM WorkflowInstance w");
query.executeUpdate |
 4 | .objectdb.jpa.JpaQuery.executeUpdate(JpaQuery.java:776)
at com.objectdb.o.QRP.L(QRP.java:251 ... .QRR.f(QRR.java:153)
at com.objectdb.jpa.JpaQuery.executeUpdate(JpaQuery.java:776 ... .executeUpdate();
em.getTransaction().commit();
}
catch (Throwable t |
 4 | when no transaction is active (error 611) at com.objectdb.jpa.JpaQuery.executeUpdate(JpaQuery.java ... updateCount = query.setParameter("value", userCredential.getRegisteredEmailD()).executeUpdate ... surrounding your executeUpdate with em.getTransaction().begin() to start the transaction and em |
 4 | You can execute a DELETE query:
em.createQuery("DELETE FROM MyEntity e").executeUpdate ... it is "executeUpdate()", query.getresultlist() cause exceptions. Yes, you'd better to put it into ... . The code “createQuery("DELETE FROM MyEntity e").executeUpdate();” works, but it can not reset id to zero |