Confusion between JPA and Hibernate cascading

后端 未结 2 1368
情歌与酒
情歌与酒 2020-12-15 08:31

I\'m using Hibernate 3.6 and have my code annotated (versus using hibernate mapping files). I ran into the known \"problem\" of using JPA cascading options that are not com

2条回答
  •  不思量自难忘°
    2020-12-15 08:45

    From Hibernate reference documentation

    For each basic operation of the Hibernate session - including persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), evict(), replicate() - There is a corresponding cascade style

    If you see CascadeType documentation, you will see each cascade style for each session operation

    How do I decide whether to use JPA cascade options or the Hibernate @Cascade annotation instead ?

    Prefer to use plain JPA cascade style when using a plain JPA application. If using Hibernate, prefer Hibernate cascade style

提交回复
热议问题