Patent ID: 7536401

Claim:
A computer-implemented method for reducing dependency calculation time in object persistence with circular referential integrity dependency, comprising: building a graph using foreign key dependency from object to relational mapping, where nodes of the graph are object types and connected directionally from a source containing a foreign key to a target of a foreign key reference; topologically sorting the graph to order dependencies among the nodes including circular dependences, wherein topologically sorting the graph comprises: traversing the graph; reversing directional connections of the nodes; and collapsing nodes previously visited via the traversing until all circular paths are removed from the graph; encapsulating the circular dependencies as one or more complex nodes; performing object dependency calculations on the nodes and the one or more complex nodes in the graph, wherein the object dependency calculations are performed in a hierarchical manner, comprising: analyzing all object types within each of the one or more complex nodes for persistence operations; calculating, using a computer, dependency at an object instance level when all object types within one of the one or more complex nodes have persistence operations; breaking circular dependencies when any object types within the one or more complex nodes do not have persistence operations and calculating dependency on all nodes that do not contain a nested complex node; and repeating said analysis and calculations for all nested nodes; and using results of the object dependency calculations to generate a sequence to modify the objects that maintains referential integrity in a relational database.