Hi. Is it possible in JPA to reference entities from another, and have them automatically delete if the reference is just removed?
I.e. if the entity is: public class E_Campaign implements Accounted { @Id private long id; @OneToMany(cascade = CascadeType.ALL, mappedBy = "campaign") private Collection<E_VehicleAssociation> vehicles; } And the dependent entity is: public class E_VehicleAssociation { @Id private long id; @ManyToOne private E_Campaign campaign; } Is it possible to do something like this, and have that delete the dependent entity: campaign.getVehicles().remove(0); em.merge(campaign); I.e., I'm removing the reference to an element of campaign.vehicles() would remove that entity from the VehicleAssociation table? More specifically, I'm interested in auto-deleting all entities that are references by a particular campaign, and want to avoid iterating and deleting. Thank you! Pawel. P.S. Any idea when JPA2.1 will be implemented by OpenJPA? :)