This seems oddly limited.
Assume I have a table of users and a table of role types and a mapping table for a many to many associaition. My role types are a limited set that does not change (very often).
If I create a user I just want to creat the user and a mapping to an existing role type. I do not want to create a new role type.
Similarly, when I delete a user I just want to delete the user and the mapping, I do not want to delete the role type, which is mapped to other users.
Can someone please clarify cascade type.
If you don't want cascading to occur then do not specify a cascade value in your @ManyToMany, @OneToMany or @ManyToOne. This should resolve to cascade="none" in the underlying Hibernate mapping.
The EJB 3.0 SPec in section, "10.1.12 ManyToOne Annotation", clearly states that the default is, "No operations are cascaded."
Actually the cascade semantic is a bit more subtle.
Read the 6.3 chapter of the spec for more infos