The Datasources tab manages datasources for data-aware components of the screen.
In order to add a new top-level datasource, click New.
To add a nested datasource select an existing datasource first, which will become master for the new one.
The following properties can be set for a datasource:
- Type - the datasource type.
- Id - the datasource identifier (should be unique within a screen).
- Entity - the class of an entity contained in the datasource. Not available for nested datasources, because the entity class is defined implicitly by the Property attribute.
- View - a view used to load an entity from the database. Not available for nested datasources, because the entity class is defined implicitly by the Property attribute.
- Datasource class - optional attribute defining a custom datasource implementation class.
- Max results - if set, the collection datasource will limit the maximum number of loaded entity instances. This attribute is not needed when a Filter is used together with the datasource, because the filter sets it dynamically.
- Do not refresh - if set, the collection datasource does not load data from the middleware. This checkbox corresponds to the
refreshMode="NEVER"
XML attribute.
- Load dynamic attributes - if set, dynamic attributes will be loaded for all entity instances contained in the datasource.
- Allow commit - if unchecked, changes in entities that are contained in the datasource are ignored. By default, changes are tracked and can be saved.
- Query - a JPQL query which returns a collection of entity instances. Available only for top-level collection datasources. Use
Ctrl+Space
for code completion, which shows:
- after an empty space - the list of entities;
- after dot (.) - the list of entity attributes;
- after colon (:) - the list of available parameter prefixes;
- after
:ds$
- the list of datasources;
- after
:session$
- the list of predefined session attributes.
- Property - the name of the master entity attribute, containing the entity of this nested datasource.