Package org.sqlproc.engine


package org.sqlproc.engine
The public part of the SQL Processor implementation. The most important classes are SqlQueryEngine and SqlCrudEngine. There are also some helper classes and basic interfaces.

SQL Processor is Data Driven Query Engine. It's able to dynamically generate ANSI SQL query or statement based on search data provided by an end user or an application. This is done in the runtime, without any plumbing code required.

SQL Processor has 3 basic inputs:

  • A META SQL query or statement. META SQL is an ANSI SQL extension based on ANTLR grammar. For example the META SQL query is
    select p.ID id, p.NAME name from PERSON p {= where {& p.id=:id} {& UPPER(name)=:+p.name}}
  • Input values provided by an end user. These data are collected in a search form, a standard POJO object, which can be created in a presentation layer of a web application.
  • A result class definition, which is used to carry output data from an SQL query execution. This class is a standard POJO object, instances of which are created in the SQL Processor without any plumbing code. It can work as a transport object from a persistence to a presentation layer of a web application.
Next, the SQL Processor has one output - the list of result class instances.

For the META SQL query described above the generated ANSI SQL query can be

  • select p.ID id, p.NAME name from PERSON p in the case there are no values in a search form or this search form is null.
  • select p.ID id, p.NAME name from PERSON p where id=? in the case there's a not null value for id attribute in a search form.

In the process of data collection from a search form it's used Reflection API. The same API is used in the process of seeding instances of result class with the SQL query execution output.

The package org.sqlproc.engine.impl contains non public part of the SQL Processor implementation. This part of the code can be changed any time to improve the SQL Processor capabilities.

For more info please see the Tutorials.

Author:
Vladimir Hudec