Using the Query Builder Platform in an Application
Because of its flexibility in allowing queries to be changed quickly and easily, most applications using the Java API should use the query builder platform to implement queries. The production experience, or changes in requirements, often require that you modify the query. It is much easier to update a configuration file than to install new code.
The GeneralCompoundQueryBuilder and GeneralQueryBuilder classes are extensions of ANetricsCompoundQueryBuilder and ANetricsQueryBuilder. Therefore, they can be used in any Java application that expects an implementation of one of these classes. The GeneralCompoundQueryBuilder or GeneralQueryBuilder class must be initialized with the desired configuration, either in the constructor when created, or by calling one of the setConfiguration methods before being used.
TIB_tps_qbp.jar file in the class path of the Java application.Some applications must handle both compound record matching and single table record matching. In such cases, the application can use GeneralCompoundQueryBuilder. Standard and single table record matching is provided as one of the compound record matching types available in the query configuration.
To allow the GeneralCompoundQueryBuilder and GeneralQueryBuilder classes to fit seamlessly into almost any application, the following interfaces are defined by the query builder platform: AQBPLogger, IQBPFileMgr, and IQBPLoaderMgr.
Default implementations of these interfaces are available, which are automatically applied if the application does not supply its own. Therefore, it is not necessary to provide an implementation of any of these classes. An implementation is needed only if the default behavior is not suitable.
|
Interface |
Description |
|||||||||
|
|
Gives the application control over the reporting of errors. The application can provide its own implementation of this abstract class to integrate the logging and error reporting of the query builder platform classes with the application's logging or the application can use the provided
|
|||||||||
|
|
Gives the application control over the reading of configuration files. This can include enforcing restrictions on which files can be read. It can also include allowing configurations to be read from non-standard locations, such as a DBMS or a web service. A basic implementation of this interface, |
|||||||||
|
|
Gives the application control over the dynamic loading of classes. If the configuration file contains custom classes, these classes must be dynamically loaded. For security reasons, by default, classes are only loaded from the JVM class path. Applications might want to allow classes to be loaded from other locations (such as a directory for custom class files). Applications can define their own rules for the dynamic loading of classes by providing an appropriate implementation of this interface. As with the loading of configurations, this can also be used to allow custom classes to be loaded from non-standard sources, such as a DBMS or web-service. A basic implementation of this interface, |