Confusion between JPA and Hibernate cascading
Posted
by
Jay
on Stack Overflow
See other posts from Stack Overflow
or by Jay
Published on 2010-12-27T18:18:05Z
Indexed on
2010/12/27
18:54 UTC
Read the original article
Hit count: 179
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 compatible with Hibernate's CascadeType (see this link for more info http://www.mkyong.com/hibernate/cascade-jpa-hibernate-annotation-common-mistake/).
I was hoping to get a bit more clarification on the problem. I have some particular questions:
1) So @Cascade({CascadeType.SAVE_UPDATE}) works for saveOrUpdate(), but does it apply also if I use merge() or persist()? or do I have to use all three Hibernate CascadeTypes?
2) How do I decide whether to use JPA cascade options or the Hibernate @Cascade annotation instead?
2) There is a "bug" filed against this in Hibernate, but the developers apparently see this as a documentation issue, (I'm completely disagree with them), and I'm not seeing that it was addressed in said documentation. Anyone know why this is "working as designed" and not a bug in Hibernate's JPA implementation?
Many thanks in advance.
© Stack Overflow or respective owner