Re: forcing object update

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Sep 28 2005 - 11:21:33 EDT

  • Next message: Cris Daniluk: "Re: forcing object update"

    On Sep 28, 2005, at 10:51 AM, Cris Daniluk wrote:

    > it calls
    > cayenneObj.setRelationship(List<Relationship> relationshipList).
    > Actually, it calls it 3 times - once with a list of 1, once with a
    > list of 2, once with 3.. an annoying "bug" that may have ruled out
    > some cleaner solutions..

    Yeah, that's pretty ugly... Collections do not easily map to "bean
    property" paradigm (something I ran into yet again when designing
    generic object graph model for 1.2 ObjectContexts).

    > So, what I've essentially done is created a setRelationship that
    > stores the list and marks the object as modified. Then,
    > validateOnInsert() reads the relationshipList and calls
    > removeRelationshipArray / addRelationshipArray to resync the object to
    > the list.

    BTW, I was planning to remove validateForX calls for "phantom"
    modifications, so such workaround won't work anyway.

    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-355

    Can you use the same approach, but instead of validateForX re-sync
    the object in your action code before calling commit? I know nothing
    about WebWork, but you do control the code that executes commit, right?

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Sep 28 2005 - 11:21:35 EDT