Claims
- 1. A method of providing a logical framework for defining abstract operations for accessing physical data comprising a plurality of physical entities each comprising a plurality of physical fields, the method comprising:
providing an abstract model for defining abstract operation specifications logically describing operations to access the data, the abstract model comprising:
(a) a plurality of logical fields; (b) a mapping rule for each of the plurality of logical fields, which map each of the plurality of logical fields to at least one of the physical entities of the data; and (c) a plurality of model entity definitions, each comprising at least one logical field corresponding to a physical entity; providing an interface from which each of the plurality of model entity definitions is selectable in generating an abstract operation specification to access the data of the physical entity corresponding to a selected model entity definition; and providing a run-time component to transform, according to the abstract model, the abstract operation specifications into physical operation specifications consistent with the physical data.
- 2. The method of claim 1, wherein each of the plurality of physical entities is a table in a database.
- 3. The method of claim 1, wherein each physical operation specification is selected from one of an insert statement and a delete statement.
- 4. The method of claim 1, wherein each physical operation specification is a query.
- 5. The method of claim 1, wherein the abstract operation specification is an abstract query and the interface is a user interface, and further comprising:
receiving, via the user interface, the abstract query comprising a plurality of query conditions, result fields and a selection of one of the model entity definitions; accessing the model entity definition corresponding to the selection; determining whether the model entity definition corresponding to the selection specifies one or more required result fields; and if so, adding the one or more required result fields to the query.
- 6. The method of claim 1, wherein the abstract operation specification is an abstract query and the interface is a user interface, and further comprising:
receiving, via the user interface, the abstract query comprising a plurality of query conditions, result fields and a selection of one of the model entity definitions; determining whether the abstract query includes more than one ANDed query condition for a given logical field; and if so, determining whether a one-to-many relationship exists between the selected model entity definition and a physical entity corresponding to the given logical field.
- 7. The method of claim 6, further comprising, if the one-to-many relationship exists, generating a query contribution against an additional instance of the physical entity corresponding to the given logical field.
- 8. The method of claim 7, further comprising:
generating a result field contribution for the abstract query; and generating correlation logic between each physical entity involved in the abstract query.
- 9. The method of claim 1, wherein run-time transforms, according to the abstract model, a single abstract operation specification into at least two separate physical operation specifications consistent with the physical data, wherein each physical operation specification modifies a different physical entity of the data and wherein each physical operation specifications is ordered for execution according to a physical entity relationships specification defining hierarchical relationships between the physical entities of the data.
- 10. The method of claim 9, wherein the single abstract operation specification comprises a plurality of logical field names.
- 11. The method of claim 1, further comprising:
issuing, by a requesting entity, a request to execute a single abstract operation specification; and transforming, by the run-time component, the single abstract operation specification into the at least two physical operation specifications for modifying the data.
- 12. The method of claim 11, wherein transforming the single abstract operation specification into the at least two physical operation specifications comprises:
generating the at least two physical operation specifications; and ordering the at least two physical operation specifications according to a physical entity relationships specification of the abstract model.
- 13. The method of claim 12, wherein at least one of the logical fields represents two or more data locations in the physical data and wherein the abstract model further comprises a restriction rule for the at least one logical field wherein the restriction rule specifies that modification operations on the at least one logical field are restricted to one of the two or more data locations.
- 14. The method of claim 13, wherein the two or more data locations comprise a primary key table and a foreign key table.
- 15. The method of claim 12, wherein at least one of the logical fields represents two or more data locations in the physical data and wherein the abstract model further comprises a propagate rule for the at least one logical field wherein the propagate rule specifies that modification operations on the at least one logical field are propagated to all of the two or more data locations.
- 16. The method of claim 15, wherein the two or more data locations comprise a primary key table and a foreign key table.
- 17. The method of claim 12, wherein the ordering comprises determining a primary-secondary relationship between corresponding physical entities of the at least two physical operation specifications to ensure integrity of the data.
- 18. The method of claim 12, wherein the at least two physical operation specifications are insert statements and further comprising placing the at least two insert statements in a list after the building, and wherein the ordering comprises:
for a given one of the at least two insert statements, determining a corresponding physical entity affected by the given one insert statement; for each of the other insert statements of the at least two insert statements which are at a position after the given one insert statement in the list:
determining whether the corresponding physical entity affected by the given one insert statement and a corresponding physical entity affected by the other insert statement of the at least two insert statements are related as secondary and primary, respectively; if so, moving the given one insert statement to a position after the corresponding physical entity affected by the other insert statement of the at least two insert statements.
- 19. The method of claim 18, further comprising repeating the ordering for each of the at least two insert statements until the list can be traversed without encountering a insert statement having a corresponding entity which is secondary with respect to a corresponding entity of a subsequent insert statement in the list.
- 20. The method of claim 12, wherein the at least two physical modification statements are delete statements and further comprising placing the at least two delete statements in a list after the building, and wherein the ordering comprises:
for a given one of the at least two delete statements, determining a corresponding physical entity affected by the given one delete statement; for each of the other delete statements of the at least two delete statements which are at a position after the given one delete statement in the list:
determining whether the corresponding physical entity affected by the given delete statement and a corresponding physical entity affected by the other delete statement of the at least two delete statements are related as primary and secondary, respectively; if so, moving the given one delete statement to a position after the corresponding physical entity affected by the other delete statement of the at least two delete statements.
- 21. The method of claim 20, further comprising repeating the ordering for each of the at least two delete statements until the list can be traversed without encountering a delete statement having a corresponding entity which is primary with respect to a corresponding entity of a subsequent delete statement in the list.
- 22. The method of claim 1, wherein each mapping rule comprises an access method for one of the plurality of logical fields.
- 23. The method of claim 22, wherein the access method describes a location of the physical entities of the data.
- 24. A method for constructing abstract queries defined by a plurality of logical fields which map to a plurality of physical entities of physical data having a particular physical data representation in a database, the method comprising:
receiving user input via a user interface, the input comprising a reference to a model entity definition comprising two or more logical fields each corresponding to a separate physical entity; and based on the model entity definition, selectively adding at least one of the two or more logical fields to an abstract query.
- 25. The method of claim 24, wherein each of the plurality of physical entities is a table in a database.
- 26. The method of claim 24, wherein selectively adding the at least one of the two or more logical fields comprises:
determining whether the at least one logical field is a required field; and if so, adding the at least one logical field to the abstract query.
- 27. The method of claim 24, wherein selectively adding the at least one of the two or more logical fields comprises:
determining whether the at least one logical field is already present in the abstract query; and if not, adding the at least one logical field to the abstract query.
- 28. The method of claim 24, wherein receiving the user input via the user interface further comprises:
receiving a plurality of abstract query contributions for the abstract query, wherein the plurality of abstract query contributions are defined by selected logical fields and a corresponding value for each of the selected logical fields; and receiving a plurality of result fields for the abstract query, wherein the plurality of result fields is defined by selected logical fields.
- 29. The method of claim 28, further comprising:
converting the abstract query into a physical query consistent with the particular physical data representation of the data; and executing the physical query.
- 30. The method of claim 29, wherein converting the abstract query into the physical query comprises mapping each of the logical fields of the abstract query to respective physical entities of the physical data.
- 31. A method for constructing abstract queries defined by a plurality of logical fields which map to a plurality of physical entities of physical data having a particular physical data representation in a database, the method comprising:
receiving, via a user interface, an abstract query comprising;
a selection of a model entity definition comprising two or more logical fields each corresponding to a separate physical entity; a plurality of query conditions defined by selected logical fields and a corresponding value for each of the selected logical fields; and at least one result field defined by selected logical fields; determining whether the abstract query includes more than one ANDed query condition for a given logical field corresponding to a physical entity; and if so, determining whether a one-to-many relationship exists between the model entity definition and the physical entity corresponding to the given logical field.
- 32. The method of claim 31, further comprising, if the one-to-many relationship exists, generating a query contribution against an additional instance of the physical entity corresponding to the given logical field.
- 33. The method of claim 31, further comprising:
generating a result field contribution for the abstract query; and generating correlation logic between each physical entity involved in the abstract query.
- 34. The method of claim 33, wherein each physical and the involved in the abstract query is a table in the database and wherein generating correlation logic comprises joining each table.
- 35. A method for modifying physical data comprising a plurality of physical entities and having a particular physical data representation in a database, the method comprising:
receiving a selection of an abstract modification operation; receiving a selection of a model entity definition on which to perform the abstract modification operation, the model entity definition comprising two or more logical fields each corresponding to a separate physical entity; based on at least the received selections, generating at least two physical modification statements, each modifying one of the two separate physical entities of the physical data; ordering the at least two physical modification statements; and executing modification operations according to the physical modification statements, whereby the data is modified.
- 36. The method of claim 24, wherein the ordering is done according to a physical entity relationships specification defining hierarchical relationships between physical entities of the data to ensure integrity of the data.
- 37. The method of claim 24, wherein building the at least two physical modification operations is done according to mapping rules which map the two or more logical fields to their corresponding physical entity.
- 38. A computer-readable medium containing a program which, when executed by a processor, performs operations for modifying physical data comprising a plurality of physical entities and having a particular physical data representation in a database, the operation comprising:
identifying two or more logical fields defined for a specified model entity definition on which to perform an abstract modification operation, the two or more logical fields each corresponding to a separate physical entity of the physical data; generating a single abstract modification specification abstractly defining modification operations to modify the data, wherein the abstract modification specification comprises at least the two or more logical fields; transforming the abstract modification specification into at least two physical modification statements consistent with the particular physical data representation according to mapping rules which map the logical fields of the abstract modification specification to their corresponding physical entities, wherein each of the at least two physical modification statements modifies a different physical entity of the data; ordering the at least two physical modification statements; and executing the modification operations according to the physical modification statements, whereby the data is modified.
- 39. The computer-readable medium of claim 38, wherein the ordering is performed according to a physical entity relationships specification defining hierarchical relationships between the physical entities of the data.
- 40. The computer-readable medium of claim 38, wherein the abstract modification specification comprises selection criteria for locating the at least the two physical entities.
- 41. The computer-readable medium of claim 38, wherein each mapping rule comprises an access method for each logical field of the abstract modification specification, the access method describing a physical location of a physical entity.
- 42. The computer-readable medium of claim 38, wherein the modification operations are insert operations and wherein generating the abstract modification specification, comprises:
determining required logical fields for performing the insert operation based on the two or more logical fields defined for the specified model entity definition; and receiving values for each of the required logical fields.
- 43. The computer-readable medium of claim 42, wherein determining required logical fields based on the logical seed fields is done with reference to an abstract data model comprising a plurality of logical field specifications for each of the logical fields, wherein each logical field specification relates a logical field name to a physical entity of the database and specifies a mapping rule for accessing the physical entity.
- 44. The computer-readable medium of claim 42, wherein transforming the abstract modification specification comprises determining a corresponding physical location of data for each of the required logical fields and the two or more logical fields defined for the specified model entity definition.
- 45. The computer-readable medium of claim 44, wherein determining the corresponding physical location of data for each of the required logical fields and the two or more logical fields is done with reference to an abstract data model comprising a plurality of logical field specifications for each of the logical fields, wherein each logical field specification relates a logical field to a corresponding physical entity of the database and specifies a mapping rule for accessing the corresponding physical entity.
- 46. The computer-readable medium of claim 38, wherein the modification operation is a delete operation and wherein generating the abstract modification specification, comprises:
creating an abstract delete expression based on the two or more logical fields defined for the specified model entity definition; specifying a selection condition for selecting data to delete; and adding the selection condition to the abstract delete expression.
- 47. The computer-readable medium of claim 46, wherein transforming the abstract modification specification comprises determining a corresponding physical location of data for the two or more logical fields.
- 48. The computer-readable medium of claim 47, wherein determining the corresponding physical location of data for the specified logical fields is done with reference to an abstract data model comprising a logical field specification for the two or more logical fields, wherein the logical field specification relates the two or more logical fields to a corresponding physical entity of the database and specifies a mapping rule for accessing the corresponding physical entity.
- 49. A computer-readable medium containing a program which, when executed by a processor, provides a logical framework for defining abstract query operations, the program comprising:
an abstract model for defining abstract queries logically describing operations to query the data, the abstract model comprising:
(i) a plurality of logical fields; (ii) a mapping rule for each of the plurality of logical fields, which map the plurality of logical fields to physical entities of the data; and (iii) a plurality of model entity definitions, each comprising at least two logical fields each corresponding to a separate physical entity; and a run-time component configured with transformation instructions to transform an abstract query, comprising logical fields selected according to a selected model entity definition, into a physical query consistent with the physical data.
- 50. The computer-readable medium of claim 49, wherein the abstract query comprises a plurality of logical field names and corresponding values.
- 51. The computer-readable medium of claim 49, wherein each of the plurality of model entity definitions defines at least one required logical field.
- 52. The computer-readable medium of claim 49, further comprising a physical entity relationships specification defining hierarchical relationships between the physical entities of the data.
- 53. The computer-readable medium of claim 49, further comprising a user interface from which each of the plurality of model entity definitions is selectable.
- 54. The computer-readable medium of claim 49, wherein the mapping rules comprise an access method for each of the plurality of logical fields, wherein the access method describes a location of the physical entities of the data.
- 55. A computer-readable medium containing a program which, when executed by a processor, provides a logical framework for defining abstract modification operations for modifying physical data, the program comprising:
an abstract model for defining an abstract modification specification logically describing operations to access the data, the abstract model comprising:
(i) a plurality of logical fields; (ii) a mapping rule for each of the plurality of logical fields, which map the plurality of logical fields to physical entities of the data; (iii) a plurality of model entity definitions, each comprising at least two logical fields each corresponding to a separate physical entity; and (iv) a physical entity relationships specification defining interrelationships between the physical entities of the data; and a run-time component configured with:
(i) transformation instructions to transform an abstract modification specification, comprising logical fields selected according to a selected model entity definition, into at least two physical modification statements consistent with the physical data, wherein each of the at least two physical modification statements modifies a different physical entity of the data; and (ii) ordering instructions to order the at least two physical modification statements according to the physical entity relationships specification.
- 56. The computer-readable medium of claim 55, further comprising a user interface from which each of the plurality of model entity definitions is selectable.
- 57. The computer-readable medium of claim 55, wherein each model entity definition comprises a first set of logical fields for insert operations and a second set of logical fields for delete operations.
- 58. The computer-readable medium of claim 55, wherein the abstract modification specification comprises a plurality of logical field names and corresponding values.
- 59. The computer-readable medium of claim 55, wherein the mapping rules comprise an access method for each of the plurality of logical fields, wherein the access method describes a location of the physical entities of the data.
- 60. A computer comprising a memory and at least one processor, and further comprising a logical framework for defining abstract modification operations for modifying physical data, the logical framework comprising:
an abstract model for defining an abstract modification specification logically describing an operation to modify the data, the abstract model comprising:
(i) a plurality of logical fields; (ii) a mapping rule for each of the plurality of logical fields, which map the plurality of logical fields to physical entities of the data; and (iii) a plurality of model entity definitions, each comprising at least two logical fields each corresponding to a separate physical entity; a user interface from which each of the plurality of model entity definitions is selectable; and a run-time component to transform an abstract query, comprising logical fields selected according to a selected model entity definition, into a physical query consistent with the physical data.
- 61. The computer of claim 60, further comprising a physical entity relationships specification defining interrelationships between the physical entities of the data.
- 62. The computer of claim 60, wherein each of the plurality of model entity definitions defines at least one required logical field.
- 63. The computer of claim 60, wherein the mapping rules comprise an access method for each of the plurality of logical fields, wherein the access method describes a location of the physical entities of the data.
- 64. A computer comprising a memory and at least one processor, and further comprising a logical framework for defining abstract modification operations for modifying physical data, the logical framework comprising:
an abstract model for defining an abstract modification specification logically describing an operation to modify the data, the abstract model comprising:
(i) a plurality of logical fields; (ii) a mapping rule for each of the plurality of logical fields, which map the plurality of logical fields to physical entities of the data; (iii) a plurality of model entity definitions, each comprising at least two logical fields each corresponding to a separate physical entity; and (iv) a physical entity relationships specification defining interrelationships between the physical entities of the data; a user interface from which each of the plurality of model entity definitions is selectable; and a run-time component to transform the abstract modification specification into at least two physical modification statements consistent with the physical data and to order the at least two physical modification statements according to the physical entity relationships specification, wherein each of the at least two physical modification statements modifies a different physical entity of the data.
- 65. The computer of claim 64, wherein the mapping rules comprise an access method for each of the plurality of logical fields, wherein the access method describes a location of the physical entities of the data.
- 66. The computer of claim 64, wherein each of the plurality of model entity definitions defines at least one required logical field.
- 67. The computer of claim 64, wherein each model entity definition comprises a first set of logical fields for insert operations and a second set of logical fields for delete operations.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application is related to the following commonly owned applications assigned to International Business Machines, Inc.: U.S. patent application Ser. No. 10/083,075, filed Feb. 22, 2002, entitled “IMPROVED APPLICATION FLEXIBILITY THROUGH DATABASE SCHEMA AND QUERY ABSTRACTION”; U.S. patent application Ser. No. ______ (Atty. Docket Number ROC920030005), filed on even date herewith and entitled “MODIFICATION OF A DATA REPOSITORY BASED ON AN ABSTRACT DATA REPRESENTATION”; U.S. patent application Ser. No. ______ (Atty. Docket Number ROC920030006), filed on even date herewith and entitled “SEQUENCED MODIFICATION OF MULTIPLE ENTITIES BASED ON AN ABSTRACT DATA REPRESENTATION”; U.S. patent application Ser. No.10/132,228, entitled “DYNAMIC END USER SPECIFIC CUSTOMIZATION OF AN APPLICATION'S PHYSICAL DATA LAYER THROUGH A DATA REPOSITORY ABSTRACTION LAYER”; and U.S. patent application Ser. No. 10/131,984, entitled “REMOTE DATA ACCESS AND INTEGRATION OF DISTRIBUTED DATA SOURCES THROUGH DATA SCHEMA AND QUERY ABSTRACTION”, which are hereby incorporated herein in their entirety.