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

New algorithm for tracking changes to DbEntities underlying flattened attributes and relationships

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Core Library
    • None

    Description

      Issues like CAY-1746 are demonstrating the need for a new reworked algorithm for handling updates to the tables that are mapped in Cayenne implicitly via flattened attributes or relationships. Ideally we should provide an algorithm that is independent of the individual relationship semantics, and solve all the read-only limitations (CAY-1743), etc.

      A good start would be if we could handle any combination of 2-step flattened relationships and attributes. This should provide robust support for vertical inheritance among other things (another aspect of that is fixing various runtime relationship bugs though).

      I've started building this new algorithm by creating IDs that can uniquely identify changes to each row in a "flattened' DbEntity. Tried expressing it as an ObjectId of one of the related explicitly mapped ObjEntities and an incoming DbRelationship:

      class DbArcId:
      private ObjectId sourceId;
      private DbRelationship incomingArc;

      Each record to be insterted/updated/deleted can be identified by multiple IDs (depending on which way you come to it on the graph), which we can hopefully resolve to a single snapshot and a single operation.

      Now working on converting this model to a set of BatchQueries.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: