deleteObject() and removeFrom*List()

From: Mike Kienenberger (mkienen..laska.net)
Date: Mon Jun 21 2004 - 15:27:28 EDT

  • Next message: Elia Morling: "Odds and Ends"

    Well, this is an embarrassing-simple question, but I've never needed to
    delete an object before.

    I have a situation where I need to delete an object, but it's a member of
    another object's toMany relationship list.

    My normal practice would be to modify (or delete) the object, and invalidate
    the "owner" object, but that's not practical in this case.

    Can I do something as simple as the following?

    anAccount.removeFromPaperBillWarningList(aPaperBillWarning);
    aPaperBillWarning.deleteObject();
    [...sometime much later...]
    aDataContext.commitChanges();

    Account is a read-only entity, although I do have removeFrom*List() methods
    defined for it.

    I know that this kind of situation used to cause problems under WebObjects.

    -Mike



    This archive was generated by hypermail 2.0.0 : Mon Jun 21 2004 - 15:27:32 EDT