System and methods for dynamic querying
AssigneeBEA Systems, Inc.
InventorsMatthew Shinn, Seth White, Robert Woollen
Life of this patent
Estimating the term…
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.
Claims14
A computer implemented method for dynamically generating a query to be executed against a database, comprising:
- enabling use of dynamic queries by setting a qualification tag “enable-dynamic-queries (#PCDATA)” to the value of true in a deployment descriptor, wherein “enable-dynamic-queries” represents an arbitrary name of an extensible markup language (XML) tag and wherein symbol “#PCDATA” represents that the qualification tag contains parsed character data that is parsed by an XML parser;
- deploying a bean on a server for connecting to and executing queries against the
- database, said bean having a bean home class that includes a finder method;
- generating a properties object containing settings for the query, said settings specifying one or more options for execution of the query, wherein the properties object is populated with said settings at runtime;
- invoking the finder method on said bean by an application executing on a client and passing the properties object to said bean;
- receiving the finder method invocation by said server and inspecting said properties object;
- extracting the settings from the properties object and parsing the finder method in order to generate a query statement by the bean at runtime, such that said query statement need not be statically defined in the deployment descriptor of said bean and such that the bean is not redeployed upon execution of a new query;
- executing the query statement on the database by said server;
- and
- returning a result set retrieved from the database in response to execution of the query statement by using a query home collection results method.
Dependencies are inferred from the claim text.