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

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

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core Library
    • Labels:


      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.


        Issue Links



            • Assignee:
              andrus Andrus Adamchik
              andrus Andrus Adamchik


              • Created:

                Issue deployment