-
1. Re: CascadeType
mduffy_lists Dec 14, 2004 1:04 AM (in response to smallnest)Hmmm.....
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.
Thx.
Mike -
2. Re: CascadeType
kabirkhan Dec 14, 2004 4:18 AM (in response to smallnest)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.
-
3. Re: CascadeType
mduffy_lists Dec 15, 2004 2:15 AM (in response to smallnest)Thx.
My mistake.
The EJB 3.0 SPec in section, "10.1.12 ManyToOne Annotation", clearly states that the default is, "No operations are cascaded."
Mike -
4. Re: CascadeType
epbernard Dec 28, 2004 5:17 AM (in response to smallnest)Actually the cascade semantic is a bit more subtle.
Read the 6.3 chapter of the spec for more infos