0 Replies Latest reply on Apr 17, 2009 3:31 PM by Robert Pond

    Hibernate deleting association.

    Robert Pond Newbie

      Is it possible for hibernate to delete an association object by specifying some cascade option.

      I have Object A with a collection of Object B mapped by OneToMany.

      I am removing objects from A by doing.
      a.getBs().remove(someObject) and I would like someObject to be deleted
      from the DB when I save the A object with saveOrUpdate(). Is it possible to do this or do i need to then manually delete someObject with session.delete(someObject)?

      I am using CascadeType.ALL so that when i call a.getBs.add(new B()) then the new B is saved.