Re: DELETED objects

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Aug 30 2004 - 20:11:04 EDT

  • Next message: Lindsay Steele: "RE: How Cayenne works ??"

    On Aug 30, 2004, at 10:25 AM, Claudio Rosati wrote:

    > Hello all,
    >  
    > Is it possible to "re-register" a DELETED object to its DataContext?
    >  
    > I have a non-committed DataContext where some registered object could
    > be deleted but in some circustamces should be re-attached to the
    > DataContext.
    >  
    > Thanks.
    >  
    > Claudio

    You can do that by calling DataContext.invalidateObjects(Collection).

    As this method only partially restores the object graph (unlike
    "rollbackChanges()"), there maybe undesired consequences. Namely if
    "deleted" object's Entity had "cascade" or "nullify" delete rules setup
    in the modeler for relationships, affected related objects will not be
    restored.

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Aug 30 2004 - 20:11:10 EDT