JPA 2.0 orphanRemoval=true VS on delete Cascade
问题 I am a little confused about the JPA 2.0 orphanRemoval attribute. I think I can see its is needed when I use my JPA provider\'s DB generation tools to create the underlying database DDL to have an ON DELETE CASCADE on the particular relation. However, if the DB exists and it already has an ON DELETE CASCADE on the relation, is this not enough to cascade the deletion appropriately? What does the orphanRemoval do in addition? Cheers 回答1: orphanRemoval has nothing to do with ON DELETE CASCADE .