delete « Eclipse « JPA Q&A

1. JPA: How do I synchronize the persistence context with the result of the bulk update or delete?

There's a statement in the ejb-3_0-fr-spec-persistence.pdf which reads The persistence context is not synchronized with the result of the bulk update or delete So if I do a query.executeUpdate which deletes rows from ...

2. hibernate - delete hql in eclipse hibernate tool

I tried to execute a delete query as following in eclipse's HQL tool

delete from Address address where = 6
but i got the
org.hibernate.hql.QueryExecutionRequestException: Not supported for DML operations
Please tell me that ...

3. How do I delete all JPA entities?

In my testing code I need to have a blank/empty database at each method. Is there code that would achieve that, to call in the @Before of the test?

4. JPA update many-to-many deleting records

I have a @ManyToMany relationship between two entities. When I perform an update on the owning side, it appears that JPA deletes all the linked records from my database and re-inserts ...

5. Why does not jpa2/eclipselink generate on delete cascade SQL?

@Entity public class MUser implements Serializable, MemoEntity {

private static final long serialVersionUID = 1L;
private String email;

@OneToMany(cascade=CascadeType.ALL, orphanRemoval=true)
private Set<Meaning> mengs = new HashSet<Meaning>();
Shouldn't this mean that I get the constraint with a "on ...

6. Should I let JPA or the database cascade deletions?

Let's say we have two entities, A and B. B has a many-to-one relationship to A like follows:

public class A {
  private List<B> children;

public class B {

7. EclipseLink deleting referenced entity

I'm using EclipseLink as my persistance unit. I'm having a problem on deleting an entity. Following example: a device has a type. There are many devices which could have the same ...

8. bulk delete in eclipse HQL editor