Integrating both modifications to an object model and modifications to a database into source code by an object-relational mapping tool
First Claim
Patent Images
1. 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.
0 Assignments
0 Petitions
Accused Products
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.
-
Citations
40 Claims
-
1. 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. - View Dependent Claims (2, 3, 4)
creating classes that reflect the modified version of the logical structural relationship.
-
-
3. The method of claim 2 wherein the creating includes:
creating classes in the Java programming language.
-
4. The method of claim 1 wherein the database can be accessed using JDBC methods, and wherein the importing includes:
invoking the JDBC methods to import the modified version of the logical structural relationship.
-
5. 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. - View Dependent Claims (6)
generating source code based on the object model that reflects the customizations and the modifications.
-
-
7. 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. - View Dependent Claims (8, 9, 10, 11)
generating the source code to reflect the modifications.
-
-
9. The computer-readable medium of claim 8 wherein the generating includes:
creating classes that reflect the modified version of the logical structural relationship.
-
10. The computer-readable medium of claim 9 wherein the creating includes:
creating classes in the Java programming language.
-
11. The computer-readable medium of claim 7 wherein the database can be accessed using JDBC methods, and wherein the importing includes:
invoking the JDBC methods to import the modified version of the logical structural relationship.
-
12. 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. - View Dependent Claims (13)
generating source code based on the object model that reflects the customizations and the modifications.
-
-
14. 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.
-
15. 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. - View Dependent Claims (16, 17, 18, 19)
comparing objects representing the tables in each database data structure to determine if the number of tables in the first database data structure has changed.
-
-
17. The method of claim 15, wherein comparing fields in a hash table associated with the two database data structures determines whether a type, name and number of fields of the hash table in the first database data structure have changed.
-
18. The method of claim 15, wherein comparing keys of each table of the two database data structures includes:
comparing primary keys of each table of the two database data structures to determine whether primary keys of any tables of the first database data structure have changed.
-
19. The method of claim 15, wherein comparing keys of each table of the two database data structures includes:
comparing foreign keys of each table of the two database data structures to determine whether foreign keys of any tables of the first database data structure have changed.
-
20. 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. - View Dependent Claims (21, 22, 23, 24)
determining that a new table has been added; and
creating a new object in the object model to represent the new table.
-
-
22. The method of claim 20, wherein determining whether a column has been added to a table in the set of tables in the first database data structure further includes:
-
determining that a new column has been added to a particular table in the set of tables; and
adding an entry to a hash table representing the new column within an object representing the particular table including the new column.
-
-
23. The method of claim 20, wherein determining whether a key has changed in a table in the set of tables in the first database data structure further includes:
-
determining that a new foreign key has been added to a particular table in the set of tables in the first database data structure; and
adding a new relationship object indicating the new foreign key to a list of relationship objects within an object representing the particular table including the new foreign key.
-
-
24. The method of claim 20, wherein determining whether an attribute has changed in a column in a table in the set of tables in the first database data structure further includes:
-
determining that an attribute of a column in a particular table in the set of tables has changed; and
updating an entry in a hash table representing the column that includes the changed attribute within an object representing the particular table including the column with the changed attribute.
-
-
25. 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. - View Dependent Claims (26)
selecting a table object representing a table in the object model;
creating a class 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 reflecting foreign keys of the database.
-
-
27. 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.
-
-
28. 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. - View Dependent Claims (29, 30, 31, 32)
comparing objects representing the tables in each database data structure to determine if the number of tables in the first database data structure has changed.
-
-
30. The computer-readable medium of claim 28, wherein comparing fields in a hash table associated with the two database data structures determines whether a type, name and number of fields of the hash table in the first database data structure have changed.
-
31. The computer-readable medium of claim 28, wherein comparing keys of each table of the two database data structures includes:
comparing primary keys of each table of the two database data structures to determine whether primary keys of any tables of the first database data structure have changed.
-
32. The computer-readable medium of claim 28, wherein comparing keys of each table of the two database data structures includes:
comparing foreign keys of each table of the two database data structures to determine whether foreign keys of any tables of the first database data structure have changed.
-
33. 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. - View Dependent Claims (34, 35, 36, 37)
determining that a new table has been added; and
creating a new object in the object model to represent the new table.
-
-
35. The computer-readable medium of claim 33, wherein determining whether a column has been added to a table in the set of tables in the first database data structure further includes:
-
determining that a new column has been added to a particular table in the set of tables; and
adding an entry to a hash table representing the new column within an object representing the particular table including the new column.
-
-
36. The computer-readable medium of claim 33, wherein determining whether a key has changed in a table in the set of tables in the first database data structure further includes:
-
determining that a new foreign key has been added to a particular table in the set of tables in the first database data structure; and
adding a new relationship object indicating the new foreign key to a list of relationship objects within an object representing the particular table including the new foreign key.
-
-
37. The computer-readable medium of claim 33, wherein determining whether an attribute has changed in a column in a table in the set of tables in the first database data structure further includes:
-
determining that an attribute of a column in a particular table in the set of tables has changed; and
updating an entry in a hash table representing the column that includes the changed attribute within an object representing the particular table including the column with the changed attribute.
-
-
38. 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. - View Dependent Claims (39)
selecting a table object representing a table in the object model;
creating a class 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 reflecting foreign keys of the database.
-
-
40. 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.
-
Specification