At first I've expected that with CascadeType.REMOVE
I'll be able to delete foreign keys in my table , but I sill got an exception. But with @CascadeOnDelete
it's ok .What's the difference between the two annotations?
EDIT: I've saw the DataNucleus' comment.Cascade on delete comes from org.eclipse.persistence.annotations.CascadeOnDelete
.Which raises the question how good idea is to be used.
当您使用CascadeType.Remove时,级联将由ORM工具处理,但是当您希望由数据库处理级联时,可以使用@CascadeOnDelete。但是,当您使用@CascadeOnDelete时,请确保您使用的数据库是使用应支持级联。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.