Integrating both modifications to an object model and modifications to a database into source code by an object-relational mapping tool
AssigneesSun Microsystems, Inc., Baan Development, B.V.
InventorsTony Chun Tung Ng, Timothy R. Learmont
Life of this patent
Estimating the term…
Abstract
In accordance with methods and systems consistent with the present invention, an improved object-relational mapping tool is provided that generates source code containing classes which preserve both changes to the database schema as well as customizations to a preexisting version of the classes. This functionality alleviates the programmer from having to recreate their changes to the classes when the database changes, thus saving significant development time over conventional systems.
Claims40
A method in a computer system having a first data structure reflecting a logical structural relationship among data in a database, comprising:
- creating a second data structure reflecting a modified version of the logical structural relationship among the data in the database;
- importing the modified version of the logical structural relationship from the database;
- comparing the first data structure with the second data structure to isolate the modifications made to the logical structural relationship among the data;
- and
- generating source code reflecting the modifications.
A method in a computer system having a group of data structures reflecting a logical structure of a database, comprising:
- receiving customizations into the group of data structures;
- receiving an indication that the database has been modified;
- and
- incorporating the modifications into the group of data structures while preserving the customizations.
A computer-readable medium containing instructions for controlling a computer system to perform a method, the computer system having a first data structure reflecting a logical structural relationship among data in a database, the method comprising:
- creating a second data structure reflecting a modified version of the logical structural relationship among the data in the database;
- importing the modified version of the logical structural relationship from the database;
- and
- comparing the first data structure with the second data structure to isolate the modifications made to the logical structural relationship among the data so that source code can be generated to reflect the modifications.
A computer-readable medium containing instructions for controlling a computer system to perform a method, the computer system having a group of data structures reflecting a logical structure of a database, the method comprising:
- receiving customizations into the group of data structures;
- receiving an indication that the database has been modified;
- and
- incorporating the modifications into the group of data structures while preserving the customizations.
A computer-readable memory device encoded with an object model data structure reflecting a schema of a database, the object model for use in generating source code based on the schema, the object model data structure comprising:
- at least one object that (i) receives customizations from a user, and (ii) is updated to reflect updates to the schema while preserving the customizations when the schema is updated.
A method for isolating changes between database data structures, comprising:
- comparing tables of a first database data structure with tables of a second database data structure;
- comparing fields in hash tables associated with each of the two database data structures;
- comparing keys of each table of the first and second database data structure;
- determining changes to the first database data structure based on results of the comparisons;
- updating an object model representing the changes to the first database data structure;
- and
- generating source code based on the updated object model.
A method for updating an object model representing changes to a database, comprising:
- isolating changes to a first database data structure using a second database data structure that represents customized changes to the first database data structure;
- creating an object model representing the changes to the database, based on the changes to the first database data structure;
- and
- updating the object model based on the isolated changes to the first database data structure, wherein the first database data structure is comprised of a set of tables, and wherein updating the object model further includes:
- determining whether a new table has been added to the first database data structure;
- determining whether a column has been added to a table in the set of tables in the first database data structure;
- determining whether a key has changed in a table in the set of tables in the first database data structure;
- and
- determining whether an attribute has changed in a column in a table in the set of tables in the first database data structure.
A method for generating source code from an object model that represents changes to a database, comprising:
- importing a database schema of a changed database;
- constructing a database data structure from the schema;
- isolating the database changes;
- updating an object model representing the database schema to reflect the database changes;
- and
- generating source code based on the object model.
A method for generating source code from an object model that represents changes to a database, comprising:
- selecting a table object representing a table in the object model;
- creating a class definition for the table object;
- storing the class definition into a source code file;
- adding data members for each entry in a hash table of the table object;
- adding function members associated with the data members;
- and
- adding relationships into the class definition reflecting foreign keys of the database.
A computer-readable medium, including instructions for performing a method, when executed by a processor, for isolating changes between database data structures, the method comprising:
- comparing tables of a first database data structure with tables of a second database data structure;
- comparing fields in hash tables associated with each of the two database data structures;
- comparing keys of each table of the first and second database data structure;
- determining changes to the first database data structure based on results of the comparisons;
- updating an object model representing the changes to the first database data structure;
- and
- generating source code based on the updated object model.
A computer-readable medium, including instructions for performing a method, when executed by a processor, for updating an object model representing changes to a database, the method comprising:
- isolating changes to a first database data structure using a second database data structure that represents customized changes to the first database data structure;
- creating an object model representing the changes to the database, based on the changes to the first database data structure;
- and
- updating the object model based on the isolated changes to the first database data structure, wherein the first database data structure is comprised of a set of tables, and wherein updating the object model further includes:
- determining whether a new table has been added to the first database data structure;
- determining whether a column has been added to a table in the set of tables in the first database data structure;
- determining whether a key has changed in a table in the set of tables in the first database data structure;
- and
- determining whether an attribute has changed in a column in a table in the set of tables in the first database data structure.
A computer-readable medium, including instructions, for performing a method,
- when executed by a processor, for generating source code from an object model that represents changes to a database, the method comprising:
- importing a database schema of a changed database;
- constructing a database data structure from the schema;
- isolating the database changes;
- updating an object model representing the database schema to reflect the database changes;
- and
- generating source code based on the object model.
A computer-readable medium, including instructions, for performing a method, when executed by a processor, for generating source code from an object model that represents changes to a database, comprising:
- selecting a table object representing a table in the object model;
- creating a class definition for the table object;
- storing the class definition into a source code file;
- adding data members for each entry in a hash table of the table object;
- adding function members associated with the data members;
- and
- adding relationships into the class definition reflecting foreign keys of the database.
Dependencies are inferred from the claim text.