Patent ID: 7383273

Claim:
A computer implemented method for managing object to relational one-to-many mapping for an object model mapped to a relational database, the method comprising a step of tracking changes to relationships and target objects with which a source object has one-to-many relationships of privately owned type, wherein the tracking step comprises steps of: creating, at the start of a transaction, a source clone of the source object having a primary key value, a relationship clone of a relationship in the source object, and a target clone of target objects referenced by the relationship; retrieving mapping meta-data stored in meta-data storage via a runtime mapping library which includes a set of predefined generic mapping objects and a reflection mechanism, wherein the reflection mechanism uses the mapping meta-data to instantiate an instance from a descriptor's class and iterate over descriptor's mappings to allow each mapping to set, load and transform rows from corresponding target tables into the target objects, and wherein the reflection mechanism is non-intrusive to the object model; determining, when the transaction is committed, changes to the source object and target objects by comparing the source clone to a current state of the source object, and comparing the target clone to a current state of the target objects using the primary key value of the source object added to the target objects; updating the relationship between the source object and the target objects by: determining which objects have been added, removed or changed in the relationship by examining the mapping meta-data including information of corresponding source table, one or more target tables and foreign keys of the target tables, generating an INSERT instruction for each target object of a source target that has been added, generating a DELETE instruction for each target object of a source target that has been removed, and generating an UPDATE instruction for each target object of a source target that has been changed; and producing and storing a new database that results from updating the relationship between the source object and the target objects.