Systems and methods for dynamic querying
First Claim
1. A system for dynamically generating a query to be executed on a database, comprising:
- a properties object that contains settings for a query as specified by a user, wherein the properties object is generated at runtime and receives the settings from dynamic user input received at runtime;
a finder method for initiating the query;
a descriptor that contains an enable dynamic queries element, wherein the enable dynamic queries element has a value of either true or false for enabling the query, such that invoking queries when the enable dynamic queries element has a value of false results in a remote or local exception being thrown depending on whether the queries submitted after setting the enable dynamic queries element were invoked from a local interface or a remote interface and wherein the dynamic queries element is specifiable by an enable-dynamic-queries parsed character data (PCDATA) tag, wherein said tag signifies that the dynamic queries element contains character data parsed by an extensible markup language (XML) parser;
a server computer that queries the database, the server computer receiving a call from the finder method and reading the settings from the properties object in order to generate the appropriate SQL query statements to be sent to the database, wherein the SQL query statements are generated by parsing the finder method and wherein options that are set for the SQL query statements are specified in the settings contained in the properties object;
a database connected to the server computer for executing the dynamically generated SQL query statements; and
a collection of results that is returned from the database in response to the finder method, said finder method being invoked on a query home interface used to execute dynamic queries, wherein the collection of results is stored on the server computer.
1 Assignment
0 Petitions
Accused Products
Abstract
A user can generate queries dynamically at runtime without having to redeploy the appropriate EJB or hard-code the query into the user application. A properties object can be generated to accept the query settings from the user. These settings can be extracted at runtime when the appropriate finder method is invoked, such that the desired query statement, such as a SQL statement, can be generated and executed against the database.
This description is not intended to be a complete description of, or limit the scope of, the invention. Other features, aspects, and objects of the invention can be obtained from a review of the specification, the figures, and the claims.
23 Citations
14 Claims
-
1. A system for dynamically generating a query to be executed on a database, comprising:
-
a properties object that contains settings for a query as specified by a user, wherein the properties object is generated at runtime and receives the settings from dynamic user input received at runtime; a finder method for initiating the query; a descriptor that contains an enable dynamic queries element, wherein the enable dynamic queries element has a value of either true or false for enabling the query, such that invoking queries when the enable dynamic queries element has a value of false results in a remote or local exception being thrown depending on whether the queries submitted after setting the enable dynamic queries element were invoked from a local interface or a remote interface and wherein the dynamic queries element is specifiable by an enable-dynamic-queries parsed character data (PCDATA) tag, wherein said tag signifies that the dynamic queries element contains character data parsed by an extensible markup language (XML) parser; a server computer that queries the database, the server computer receiving a call from the finder method and reading the settings from the properties object in order to generate the appropriate SQL query statements to be sent to the database, wherein the SQL query statements are generated by parsing the finder method and wherein options that are set for the SQL query statements are specified in the settings contained in the properties object; a database connected to the server computer for executing the dynamically generated SQL query statements; and a collection of results that is returned from the database in response to the finder method, said finder method being invoked on a query home interface used to execute dynamic queries, wherein the collection of results is stored on the server computer. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system for generating dynamic queries, comprising:
-
a client computer that provides a properties object which contains settings for a query specified by a user, wherein the properties object is generated at runtime and receives the settings from dynamic user input at runtime; a server computer that communicates with the client computer and a database, the server computer providing a bean associated with the database; and a finder method that specifies the query to be executed against the database, the finder method invoked on the bean provided by the server computer; a descriptor that contains an enable dynamic queries element, wherein the enable dynamic queries element has a value of either true or false for enabling the query, such that invoking queries when the enable dynamic queries element has a value of false results in a remote or local exception being thrown depending on whether the queries submitted after setting the enable dynamic queries element were invoked from a local interface or a remote interface, wherein the dynamic queries element is specifiable by an enable-dynamic-queries parsed character data (PCDATA) tag, wherein said tag signifies that the dynamic queries element contains character data parsed by an extensible markup language (XML) parser; wherein upon invocation of the finder method, the server computer extracts the settings contained in the properties object and parses the finder method in order to dynamically generate the query to be sent to the database; and a collection of results that is returned from the database in response to the finder method, said finder method being invoked on a query home interface used to execute dynamic queries. - View Dependent Claims (10, 11, 12, 13, 14)
-
Specification