[jira] Commented: (CAY-1118) ROP: setToXXX(null) does not update reverse rel

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Thu Oct 09 2008 - 11:34:11 EDT

  • Next message: Andrey Razumovsky (JIRA): "[jira] Closed: (CAY-1103) rollbackChanges is broken in ROP CayenneContext"

        [ https://issues.apache.org/cayenne/browse/CAY-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13154#action_13154 ]

    Andrus Adamchik commented on CAY-1118:
    --------------------------------------

    > The reason is that setToXXX(null) causes an invalidation on reverse property but not a removal of reverse object

    So does this fail: "assertEquals(0, o1.getTable2Array().size());" ?

    > ROP: setToXXX(null) does not update reverse rel
    > -----------------------------------------------
    >
    > Key: CAY-1118
    > URL: https://issues.apache.org/cayenne/browse/CAY-1118
    > Project: Cayenne
    > Issue Type: Bug
    > Components: Cayenne Core Library
    > Affects Versions: 3.0
    > Reporter: Andrey Razumovsky
    > Assignee: Andrus Adamchik
    > Fix For: 3.0
    >
    >
    > Following test fails. The reason is that setToXXX(null) causes an invalidation on reverse property but not a removal of reverse object
    > ClientMtTable1 o1 = context.newObject(ClientMtTable1.class);
    > ClientMtTable2 o2 = context.newObject(ClientMtTable2.class);
    > o2.setTable1(o1);
    >
    > assertEquals(1, o1.getTable2Array().size());
    > context.commitChanges(); //important line!
    >
    > o2.setTable1(null);
    > assertEquals(0, o1.getTable2Array().size());

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Thu Oct 09 2008 - 11:35:08 EDT