Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-843

Remove arbitrary reverse relationship mapping limitations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M2, 3.0
    • Core Library
    • None

    Description

      From the mailing list post:
      Remove
      We have two rules related to relationship mapping that we can really do well without:

      1. A DbRelationship always requires a reverse DbRelationship.
      2. A to-many ObjRelationship without a reverse to-one is effectively read only.

      I've done some work on a project where we've used generic persistent classes, and it occurred to me that while the two things above are indeed a property of Cayenne runtime, users don't have to worry about such low level details. Cayenne can automagically add missing reverse relationships in runtime to the corresponding entities, without user ever noticing. That simple - don't know why nobody thought of that before

      BTW what makes (2) painless is CayenneDataObject that can store arbitrary data in it, so a back pointer from toOne side to the toMany site can be stored. This won't work in case of POJO's (without extra enhancement), but for normal Cayenne we get that functionality out of the box.

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: