简体   繁体   中英

JPA CascaseType - Persist and Merge Only

I have a @OneToMany from Parent to Children. It's bi-directional.

I want the only the cascade type to be persist and merge. Not remove. The only attribute value for cascade type is ALL or one of each of the other types on the enum.

Is this possible?

Thanks

使用这样的注释

@OneToMany (cascade = {CascadeType.MERGE,CascadeType.PERSIST})

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM