Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.5
  Go To Table Of Contents


Use @DeleteAll to indicate that when an relationship is deleted, EclipseLink should use a delete all query. This typically happens if the relationship is PrivateOwned and its owner is deleted. In that case, the members of the relationship will be deleted without reading them in.

Annotation Elements

There are no elements for this annotation.



Use this annotation with caution. EclipseLink will not validate whether the target entity is mapped in such a way as to allow the delete all to work.


Example 2-38 shows how to use @DeleteAll on a relationship mapping.

Example 2-38 Using @DeleteAll Annotation

public class Department {
  @OneToMany(mappedBy = "department")
  public List<Equipment> getEquipment() {
    return equipment;

Example 2-38 shows how to use the <delete-all> element in the eclipselink-orm.xml file.

Example 2-39 Using <delete-all> XML

<entity class="Department">
    <one-to-many name="equipment" target-entity="Equipment" mapped-by="department">

See Also

For more information, see: