System and method for generating code for query object interfacing
First Claim
1. A system for generating interface definitions and source code which implement a query object for accessing a database using a predetermined programming language in a computer having a memory, the system comprising:
- an input mechanism which receives an input query from a user;
a query translator which translates query commands in the input query to database commands used with the database; and
at least one code generator class in the memory, which contains methods which generate the source code required to implement the query object, the code generator class generating source code that is specific to the database to be accessed and the programming language and that uses the database commands to generate the interface definitions and the source code.
2 Assignments
0 Petitions
Accused Products
Abstract
A query object generator tool is used to generate interface definitions and source code which implement a database query object. The tool allows a client to construct a query object without being familiar with the underlying database language and without being concerned with programming details such as concurrency problems and connection management. The tool consists of an internal state object which represents the query object, including information which can be saved to reconstruct the query object at a later date, and code generator objects which generate the code required to implement the query object defined by the internal state object. In a preferred embodiment, the code generator objects are arranged in a hierarchy so that a generator object can be instantiated which generator object is specific to the database to be accessed and the language to which the implementation is targeted. An optional graphic user interface (GUI) may also be provided to allow a user to interact with the tool.
-
Citations
23 Claims
-
1. A system for generating interface definitions and source code which implement a query object for accessing a database using a predetermined programming language in a computer having a memory, the system comprising:
-
an input mechanism which receives an input query from a user;
a query translator which translates query commands in the input query to database commands used with the database; and
at least one code generator class in the memory, which contains methods which generate the source code required to implement the query object, the code generator class generating source code that is specific to the database to be accessed and the programming language and that uses the database commands to generate the interface definitions and the source code. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. A method for generating interface definitions and source code which implement a query object for accessing a database using a predetermined programming language in a computer having a memory, the method comprising the steps of:
-
(a) receiving an input query from a user;
(b) translating query commands in the input query to database commands used with the database; and
(c) creating a plurality of code generator classes in the memory, each of which contains methods which generate the source code required to implement the query object, the code generator classes generating source code that is specific to the database to be accessed and the programming language and that uses the database commands to generate the interface definitions and the source code. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
(d) generating a graphic user interface on a display mechanism to allow the user to interact with the system.
-
-
14. A method according to claim 13 wherein step (d) further comprises the step of:
(d1) using the graphic user interface to receive from the user input queries expressed as text strings.
-
15. A method according to claim 12 further comprising the step of:
(e) creating an internal state object in the memory which internal state object represents the query object.
-
16. A method according to claim 12 wherein step (e) further comprises the step of:
(e1) creating an internal state object which includes configuration information which can be saved and retrieved to reconstruct the query object.
-
17. A method according to claim 12 further comprising the step of:
(f) instantiating a code generator object in the memory for the database and selected implementation logic and wherein the code generator object generates both interface code to allow a client to access the query object and source code which implements the query object for the selected implementation logic.
-
18. A method according to claim 12 further comprising the step of:
(g) creating a database schema access object in the memory which object contains methods for accessing the database and extracting database schema information from the database.
-
19. A method according to claim 18 further comprising the step of:
-
(h) generating a graphic user interface on a display mechanism to allow the user to interact with the system; and
(i) displaying the extracted database schema to the user using the graphic user interface.
-
-
20. A method according to claim 12 wherein step (c) comprises the step of:
(c1) generating a plurality of predefined source code statements with a template.
-
21. A method according to claim 20 wherein the query object comprises a plurality of queries and wherein step (c) comprises the steps of:
(c2) generating a predefined source code statement for each query in the query object.
-
22. A method according to claim 12 wherein step (c) comprises the step of:
(c3) generating build scripts for building a query object from the query object source code.
-
23. A computer program product for generating interface definitions and source code which implement a query object for accessing a database using a predetermined programming language in a computer having a memory, the computer program product comprising a computer usable medium having computer readable program code thereon including:
-
program code which receives an input query from a user;
program code which translates query commands in the input query to database commands used with the database; and
a plurality of code generator classes, each of which contains methods which generate the code required to implement the query object, the code generator classes generating source code that is specific to the database to be accessed and the programming language and uses the database commands to generate the interface definitions and the source code.
-
Specification