Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.2 branch
    • Fix Version/s: Undefined future
    • Component/s: Core Library
    • Labels:
      None

      Description

      This is somewhere between a bu and a new feature. Normally Cayenne allows uni-directional mapping of ObjRelationships, as long as underlying DbRelationships
      are bi-directional.

      Problem:

      Uni-directional to-many do not work. Symptom of this is saving a FK column value of the "to-many" side object as NULL, when it was added to the parent object via "parent.addToXyzArray(child)".

      This was originally reported by Scott Merritt. His example is attached to the bug report.

      [LATER COMMENT BY ARNDT]

      we just stumbled over this same problem, went all the way through debugging it and finally found the unit-test that is supposed
      to test this.

      OneWayOneToManyTst.testReadList()

      However, the assertion assertNotNull(a2) is really misleading - it suggests that this is a successfull test, but the result in fact is totallay wrong! (empty list instead of
      2 entries)

      so I have difficulties qualifiyng this as a "missing feature", and I would like to see at least to have this constraint added
      to the datamap-validation to see a warning
      about this.

      Or , of course, even better - make it work

      regards,

      Arndt

        Activity

        Hide
        Andrus Adamchik added a comment -

        One way to many can be read already... The remaining problem is to update objects appropriately when a relationship changes (target objects added/removed from the list)

        [implementation direction]

        As ObjectStore is notified of all relationship updates, we can implement logic similar to what we do with flattened relationships - just store a modification in a new map in ObjectStore until commit, and then use it to build the right snapshots...

        Show
        Andrus Adamchik added a comment - One way to many can be read already... The remaining problem is to update objects appropriately when a relationship changes (target objects added/removed from the list) [implementation direction] As ObjectStore is notified of all relationship updates, we can implement logic similar to what we do with flattened relationships - just store a modification in a new map in ObjectStore until commit, and then use it to build the right snapshots...
        Hide
        Andrus Adamchik added a comment -

        This is old ... I guess we'll implement something similar as a part of JPA effort

        Show
        Andrus Adamchik added a comment - This is old ... I guess we'll implement something similar as a part of JPA effort

          People

          • Assignee:
            Andrus Adamchik
            Reporter:
            Andrus Adamchik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development