Appboard/old/query entities

Revision as of 03:50, 17 July 2014 by imported>Jason.nicholls (moved AppBoard Query Entities to appboard/old/query entities)
Query Entities are Special Types of Data Sources

The Query Entity adapter provides a means to create new Data Sources by applying SQL queries against other AppBoard Data Sources to create a specific View of the data. For example, the JDBC adapter might be used to bring in a specific set of tables into AppBoard, and the Query Entity would then be used to create a specific view of that data. The AppBoard Data Source and Data Collections wizards provide a subset of the capabilities provided by the Entity Query adapter (pivot, sort, group), but do not provide the flexibility to do so that is provided by SQL.

The following illustration shows the creation of two widgets, one using a standard Data Source and one using an Entity Query Data Source:

Example of Widgets Using Both a Standard Data Source and Entity Query Data Source

The "States Map" Widget in the above illustration uses a standard Data Source. The "Populous States Map" Widget, however, uses an Entity Query Data Source. Only the records for the states with populations greater than 2,000,000 are provided to the "Populous States Map" Widget.

Advantages of using the Entity Query Widget include the following:

  1. The Entity Query Widget supports full SQL expressions for selecting exactly the data that is needed for a Widget.
  2. The Entity Query Widget creates a Data Source that is recognized by Appboard in any component where a Data Source is used.
  3. The results of the Entity Query Widget can be assigned to a Data Collection and examined using the Data Collections wizard.
  4. As opposed to some other types of filtering in AppBoard, filtering done with Entity Queries is viewable as a Data Source in the list of AppBoard Data Sources, alongside all other configured Data Sources.


Using the Entity Query Adapter

To use the Entity Query Adapter, simply create a Data Source with the Entity Query type (located under the Utilities category of Data Source types). Be sure to enter at least the following properties on the Data Source configuration screen:

  • namespace: The name of the original Data Source. For example, in the above illustration this would be the full "U.S. States" Data Source name, such as "sample.USA_States"
  • filter: The SQL filter to be applied to the data. For example, in the above illustration you would enter: 'Population' > 2000000

For more information about the properties in configuring the Entity Query Adapter, see Query Entity Data Source Configuration.