You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2012/10/11 19:13:02 UTC

[jira] [Created] (CAY-1747) New algorithm for tracking changes to DbEntities underlying flattened attributes and relationships

Andrus Adamchik created CAY-1747:
------------------------------------

             Summary: New algorithm for tracking changes to DbEntities underlying flattened attributes and relationships
                 Key: CAY-1747
                 URL: https://issues.apache.org/jira/browse/CAY-1747
             Project: Cayenne
          Issue Type: Improvement
          Components: Core Library
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
             Fix For: 3.2M1


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.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira