0 Replies Latest reply on Sep 18, 2008 4:28 PM by chris wang

    How to turn off cascading saving/deleting

    chris wang Newbie

      I have a SITE, and a SHIPTYPE table. These two table have a many-to-may relationship (the cross reference table is SHIPTYPE_X_SITE). I created the corresponding entities Site and ShipType. For the creation of ShipType, my UI has ShipType related fields as well as a list of sites. Therefore,ShipType has a collection of Sites:

      private List sites;

      and the cross reference records are saved when I save ShipType. That is good.

      On the other side, the creation of Site just have some basic Site related fields. There is no list of ShipTYPES in the UI.

      However, I do have the need to retrieve list of ShipTypes associated with a site sometimes. So I added following association to Site entity bean:

      private List shipTypes;

      Once I did that, if I modify Site and save (collection shipTypes is null), all the cross reference records are gone for the given site. My question is how can I make the Site bean has the association, but not doing the cascading? Thank you very much for you help.