Projects:HQL Based Tables/Technical Specifications
Application Dictionary
- In the Table tab:
- Add a new option to the Data Origin combo: HQL
- If that option is selected, show a new field: HQL Query
- In the Column tab:
- Add a Alias column, to allow using that column in the HQL Expression. Show only if the Data Origin used in its table is HQL
New Generic Datasource for HQL Tables
- It will be a read only datasource, will subclass ReadOnlyDataSourceService
- It will provide a default implementation for the following capabilities:
- Filtering
- Sorting
- Combo population for FK filters
- Pagination
- It will provide the same security measures as the standard datasources
Customizing the HQL Query
There will be two ways of modifying the HQL query defined at table level:
- Modifying the structure of the query itself. For that a method similar to this one could be implemented. It will take the original query and an object (probably a JSON Object) containing the context, and it will return the modified query. It can modify the query internals, but not the number or order of the returned parameters.
String getQuery(String query, Object context)
- Adding additional filters without modifying the original query internals. For that, a method similar to this one can be implemented:
String getAdditionFilters(Object context)
These two methods will be retrieved using Dependency Injection. There can be several injections per table, but only one of them will be used, based on its priority. A method similar to this will be provided to establish the priority:
int getPriority(Object context)